diff options
author | Evan Cheng <evan.cheng@apple.com> | 2009-09-30 08:53:01 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2009-09-30 08:53:01 +0000 |
commit | ce5a8ca3ef91f59543fdca25e88e2c15ff7494de (patch) | |
tree | 4717311588a2701223ffe88e1944808f2d523c0a /llvm/lib/Target | |
parent | f305ead1cce10fd3f82dbf46cd956d4551711b0d (diff) | |
download | bcm5719-llvm-ce5a8ca3ef91f59543fdca25e88e2c15ff7494de.tar.gz bcm5719-llvm-ce5a8ca3ef91f59543fdca25e88e2c15ff7494de.zip |
Add a option which would move ld/st multiple pass before post-alloc scheduling.
llvm-svn: 83145
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r-- | llvm/lib/Target/ARM/ARMTargetMachine.cpp | 17 | ||||
-rw-r--r-- | llvm/lib/Target/ARM/ARMTargetMachine.h | 1 |
2 files changed, 17 insertions, 1 deletions
diff --git a/llvm/lib/Target/ARM/ARMTargetMachine.cpp b/llvm/lib/Target/ARM/ARMTargetMachine.cpp index dcb64c5131c..ef42bd20caf 100644 --- a/llvm/lib/Target/ARM/ARMTargetMachine.cpp +++ b/llvm/lib/Target/ARM/ARMTargetMachine.cpp @@ -22,6 +22,10 @@ #include "llvm/Target/TargetRegistry.h" using namespace llvm; +static cl::opt<bool> +LdStBeforeSched("ldstopti-before-sched2", cl::Hidden, + cl::desc("Move ld / st multiple pass before postalloc scheduling")); + static const MCAsmInfo *createMCAsmInfo(const Target &T, const StringRef &TT) { Triple TheTriple(TT); @@ -101,11 +105,22 @@ bool ARMBaseTargetMachine::addPreRegAlloc(PassManagerBase &PM, return true; } +bool ARMBaseTargetMachine::addPreSched2(PassManagerBase &PM, + CodeGenOpt::Level OptLevel) { + // FIXME: temporarily disabling load / store optimization pass for Thumb1. + if (OptLevel != CodeGenOpt::None && !Subtarget.isThumb1Only()) + if (LdStBeforeSched) + PM.add(createARMLoadStoreOptimizationPass()); + + return true; +} + bool ARMBaseTargetMachine::addPreEmitPass(PassManagerBase &PM, CodeGenOpt::Level OptLevel) { // FIXME: temporarily disabling load / store optimization pass for Thumb1. if (OptLevel != CodeGenOpt::None && !Subtarget.isThumb1Only()) { - PM.add(createARMLoadStoreOptimizationPass()); + if (!LdStBeforeSched) + PM.add(createARMLoadStoreOptimizationPass()); PM.add(createIfConverterPass()); } diff --git a/llvm/lib/Target/ARM/ARMTargetMachine.h b/llvm/lib/Target/ARM/ARMTargetMachine.h index 420305500f4..71a53488f16 100644 --- a/llvm/lib/Target/ARM/ARMTargetMachine.h +++ b/llvm/lib/Target/ARM/ARMTargetMachine.h @@ -50,6 +50,7 @@ public: // Pass Pipeline Configuration virtual bool addInstSelector(PassManagerBase &PM, CodeGenOpt::Level OptLevel); virtual bool addPreRegAlloc(PassManagerBase &PM, CodeGenOpt::Level OptLevel); + virtual bool addPreSched2(PassManagerBase &PM, CodeGenOpt::Level OptLevel); virtual bool addPreEmitPass(PassManagerBase &PM, CodeGenOpt::Level OptLevel); virtual bool addCodeEmitter(PassManagerBase &PM, CodeGenOpt::Level OptLevel, MachineCodeEmitter &MCE); |