llvm.org GIT mirror llvm / 438b598
[MergedLoadStoreMotion] Move pass enabling option to PassManagerBuilder git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217538 91177308-0d34-0410-b5e6-96231b3b80d8 Gerolf Hoflehner 6 years ago
2 changed file(s) with 8 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
6868 static cl::opt UseCFLAA("use-cfl-aa",
6969 cl::init(false), cl::Hidden,
7070 cl::desc("Enable the new, experimental CFL alias analysis"));
71
72 static cl::opt
73 EnableMLSM("mlsm", cl::desc("Enable motion of merged load and store"),
74 cl::init(true));
7175
7276 PassManagerBuilder::PassManagerBuilder() {
7377 OptLevel = 2;
227231 addExtensionsToPM(EP_LoopOptimizerEnd, MPM);
228232
229233 if (OptLevel > 1) {
230 MPM.add(createMergedLoadStoreMotionPass()); // Merge load/stores in diamond
234 if (EnableMLSM)
235 MPM.add(createMergedLoadStoreMotionPass()); // Merge ld/st in diamonds
231236 MPM.add(createGVNPass(DisableGVNLoadPRE)); // Remove redundancies
232237 }
233238 MPM.add(createMemCpyOptPass()); // Remove memcpy / form memset
387392 PM.add(createGlobalsModRefPass()); // IP alias analysis.
388393
389394 PM.add(createLICMPass()); // Hoist loop invariants.
390 PM.add(createMergedLoadStoreMotionPass()); // Merge load/stores in diamonds
395 if (EnableMLSM)
396 PM.add(createMergedLoadStoreMotionPass()); // Merge ld/st in diamonds.
391397 PM.add(createGVNPass(DisableGVNLoadPRE)); // Remove redundancies.
392398 PM.add(createMemCpyOptPass()); // Remove dead memcpys.
393399
9696 //===----------------------------------------------------------------------===//
9797 // MergedLoadStoreMotion Pass
9898 //===----------------------------------------------------------------------===//
99 static cl::opt
100 EnableMLSM("mlsm", cl::desc("Enable motion of merged load and store"),
101 cl::init(true));
10299
103100 namespace {
104101 class MergedLoadStoreMotion : public FunctionPass {
610607 AA = &getAnalysis();
611608
612609 bool Changed = false;
613 if (!EnableMLSM)
614 return false;
615610 DEBUG(dbgs() << "Instruction Merger\n");
616611
617612 // Merge unconditional branches, allowing PRE to catch more