/// populateModulePassManager - This sets up the primary pass manager.
void populateModulePassManager(PassManagerBase &MPM);
void populateLTOPassManager(PassManagerBase &PM, bool Internalize,
- bool RunInliner);
+ bool RunInliner, bool DisableGVNLoadPRE = false);
};
+
/// Registers a function for adding a standard set of passes. This should be
/// used by optimizer plugins to allow all front ends to transparently use
/// them. Create a static instance of this class in your plugin, providing a
PassManagerBuilder::addGlobalExtension(Ty, Fn);
}
};
+
} // end namespace llvm
#endif
void PassManagerBuilder::populateLTOPassManager(PassManagerBase &PM,
bool Internalize,
- bool RunInliner) {
+ bool RunInliner,
+ bool DisableGVNLoadPRE) {
// Provide AliasAnalysis services for optimizations.
addInitialAliasAnalysisPasses(PM);
PM.add(createFunctionAttrsPass()); // Add nocapture.
PM.add(createGlobalsModRefPass()); // IP alias analysis.
- PM.add(createLICMPass()); // Hoist loop invariants.
- PM.add(createGVNPass()); // Remove redundancies.
- PM.add(createMemCpyOptPass()); // Remove dead memcpys.
+ PM.add(createLICMPass()); // Hoist loop invariants.
+ PM.add(createGVNPass(DisableGVNLoadPRE)); // Remove redundancies.
+ PM.add(createMemCpyOptPass()); // Remove dead memcpys.
// Nuke dead stores.
PM.add(createDeadStoreEliminationPass());
static cl::opt<bool> DisableInline("disable-inlining",
cl::desc("Do not run the inliner pass"));
+static cl::opt<bool> DisableGVNLoadPRE("disable-gvn-loadpre",
+ cl::desc("Do not run the GVN load PRE pass"));
+
const char* LTOCodeGenerator::getVersionString() {
#ifdef LLVM_VERSION_INFO
return PACKAGE_NAME " version " PACKAGE_VERSION ", " LLVM_VERSION_INFO;
passes.add(new TargetData(*_target->getTargetData()));
PassManagerBuilder().populateLTOPassManager(passes, /*Internalize=*/ false,
- !DisableInline);
+ !DisableInline,
+ DisableGVNLoadPRE);
// Make sure everything is still good.
passes.add(createVerifierPass());