Add a new PassManagerBuilder customization point,

EP_ModuleOptimizerEarly, to allow passes to be added before the
main ModulePass optimizers.

llvm-svn: 148329
This commit is contained in:
Dan Gohman 2012-01-17 20:51:32 +00:00
parent 030b0d77ed
commit b9936296d3
2 changed files with 6 additions and 0 deletions

View File

@ -60,6 +60,10 @@ public:
/// out of the frontend.
EP_EarlyAsPossible,
/// EP_ModuleOptimizerEarly - This extension point allows adding passes
/// just before the main module-level optimization passes.
EP_ModuleOptimizerEarly,
/// EP_LoopOptimizerEnd - This extension point allows adding loop passes to
/// the end of the loop optimizer.
EP_LoopOptimizerEnd,

View File

@ -110,6 +110,8 @@ void PassManagerBuilder::populateModulePassManager(PassManagerBase &MPM) {
addInitialAliasAnalysisPasses(MPM);
if (!DisableUnitAtATime) {
addExtensionsToPM(EP_ModuleOptimizerEarly, MPM);
MPM.add(createGlobalOptimizerPass()); // Optimize out global vars
MPM.add(createIPSCCPPass()); // IP SCCP