cl::opt<bool> AIX("aix",
cl::desc("Generate AIX/xcoff instead of Darwin/MachO"),
cl::Hidden);
+
+ cl::opt<bool> EnablePPCLSR("enable-lsr-for-ppc",
+ cl::desc("Enable LSR for PPC (beta option!)"),
+ cl::Hidden);
}
namespace {
{}
unsigned PPC32TargetMachine::getJITMatchQuality() {
- return 0;
#if defined(__POWERPC__) || defined (__ppc__) || defined(_POWER)
return 10;
#else
bool PowerPCTargetMachine::addPassesToEmitAssembly(PassManager &PM,
std::ostream &Out) {
bool LP64 = (0 != dynamic_cast<PPC64TargetMachine *>(this));
+
+ if (EnablePPCLSR) {
+ PM.add(createLoopStrengthReducePass());
+ PM.add(createCFGSimplificationPass());
+ }
// FIXME: Implement efficient support for garbage collection intrinsics.
PM.add(createLowerGCPass());
}
void PowerPCJITInfo::addPassesToJITCompile(FunctionPassManager &PM) {
+ if (EnablePPCLSR) {
+ PM.add(createLoopStrengthReducePass());
+ PM.add(createCFGSimplificationPass());
+ }
+
// FIXME: Implement efficient support for garbage collection intrinsics.
PM.add(createLowerGCPass());
///
PPC32TargetMachine::PPC32TargetMachine(const Module &M, IntrinsicLowering *IL)
: PowerPCTargetMachine(PPC32ID, IL,
- TargetData(PPC32ID,false,4,4,4,4,4,4,2,1,4),
+ TargetData(PPC32ID,false,4,4,4,4,4,4,2,1,1),
PowerPCFrameInfo(*this, false)), JITInfo(*this) {}
/// PPC64TargetMachine ctor - Create a LP64 architecture model
///
PPC64TargetMachine::PPC64TargetMachine(const Module &M, IntrinsicLowering *IL)
: PowerPCTargetMachine(PPC64ID, IL,
- TargetData(PPC64ID,false,8,4,4,4,4,4,2,1,4),
+ TargetData(PPC64ID,false,8,4,4,4,4,4,2,1,1),
PowerPCFrameInfo(*this, true)) {}
unsigned PPC32TargetMachine::getModuleMatchQuality(const Module &M) {
+ // We strongly match "powerpc-*".
+ std::string TT = M.getTargetTriple();
+ if (TT.size() >= 8 && std::string(TT.begin(), TT.begin()+8) == "powerpc-")
+ return 20;
+
if (M.getEndianness() == Module::BigEndian &&
M.getPointerSize() == Module::Pointer32)
- return 10; // Direct match
+ return 10; // Weak match
else if (M.getEndianness() != Module::AnyEndianness ||
M.getPointerSize() != Module::AnyPointerSize)
return 0; // Match for some other target