diff options
author | Gerolf Hoflehner <ghoflehner@apple.com> | 2014-09-10 19:55:29 +0000 |
---|---|---|
committer | Gerolf Hoflehner <ghoflehner@apple.com> | 2014-09-10 19:55:29 +0000 |
commit | 24815d9b8f38e2a88b31863db70ac0c700ff2e3c (patch) | |
tree | 1783b05d101dd31becbe6f8b89017bf0b2f634e4 /llvm/lib/Transforms | |
parent | 4b916b21b47d1bf9b4676ce960f85130602df7f5 (diff) | |
download | bcm5719-llvm-24815d9b8f38e2a88b31863db70ac0c700ff2e3c.tar.gz bcm5719-llvm-24815d9b8f38e2a88b31863db70ac0c700ff2e3c.zip |
[MergedLoadStoreMotion] Move pass enabling option to PassManagerBuilder
llvm-svn: 217538
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/IPO/PassManagerBuilder.cpp | 10 | ||||
-rw-r--r-- | llvm/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp | 5 |
2 files changed, 8 insertions, 7 deletions
diff --git a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp index fb56088d361..8d5d14af64b 100644 --- a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp +++ b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp @@ -70,6 +70,10 @@ static cl::opt<bool> UseCFLAA("use-cfl-aa", cl::init(false), cl::Hidden, cl::desc("Enable the new, experimental CFL alias analysis")); +static cl::opt<bool> +EnableMLSM("mlsm", cl::desc("Enable motion of merged load and store"), + cl::init(true)); + PassManagerBuilder::PassManagerBuilder() { OptLevel = 2; SizeLevel = 0; @@ -228,7 +232,8 @@ void PassManagerBuilder::populateModulePassManager(PassManagerBase &MPM) { addExtensionsToPM(EP_LoopOptimizerEnd, MPM); if (OptLevel > 1) { - MPM.add(createMergedLoadStoreMotionPass()); // Merge load/stores in diamond + if (EnableMLSM) + MPM.add(createMergedLoadStoreMotionPass()); // Merge ld/st in diamonds MPM.add(createGVNPass(DisableGVNLoadPRE)); // Remove redundancies } MPM.add(createMemCpyOptPass()); // Remove memcpy / form memset @@ -388,7 +393,8 @@ void PassManagerBuilder::addLTOOptimizationPasses(PassManagerBase &PM) { PM.add(createGlobalsModRefPass()); // IP alias analysis. PM.add(createLICMPass()); // Hoist loop invariants. - PM.add(createMergedLoadStoreMotionPass()); // Merge load/stores in diamonds + if (EnableMLSM) + PM.add(createMergedLoadStoreMotionPass()); // Merge ld/st in diamonds. PM.add(createGVNPass(DisableGVNLoadPRE)); // Remove redundancies. PM.add(createMemCpyOptPass()); // Remove dead memcpys. diff --git a/llvm/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp b/llvm/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp index 867a9daa1ed..dad62fa26f9 100644 --- a/llvm/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp +++ b/llvm/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp @@ -97,9 +97,6 @@ using namespace llvm; //===----------------------------------------------------------------------===// // MergedLoadStoreMotion Pass //===----------------------------------------------------------------------===// -static cl::opt<bool> -EnableMLSM("mlsm", cl::desc("Enable motion of merged load and store"), - cl::init(true)); namespace { class MergedLoadStoreMotion : public FunctionPass { @@ -611,8 +608,6 @@ bool MergedLoadStoreMotion::runOnFunction(Function &F) { AA = &getAnalysis<AliasAnalysis>(); bool Changed = false; - if (!EnableMLSM) - return false; DEBUG(dbgs() << "Instruction Merger\n"); // Merge unconditional branches, allowing PRE to catch more |