add EP_OptimizerLast extension point

llvm-svn: 153353
This commit is contained in:
Kostya Serebryany 2012-03-23 23:22:59 +00:00
parent 8737480dfa
commit e505a5abe9
2 changed files with 5 additions and 0 deletions

View File

@ -73,6 +73,10 @@ public:
/// cleanup-ish optimizations. /// cleanup-ish optimizations.
EP_ScalarOptimizerLate, EP_ScalarOptimizerLate,
/// EP_OptimizerLast -- This extension point allows adding passes that
/// run after everything else.
EP_OptimizerLast,
/// EP_EnabledOnOptLevel0 - This extension point allows adding passes that /// EP_EnabledOnOptLevel0 - This extension point allows adding passes that
/// should not be disabled by O0 optimization level. The passes will be /// should not be disabled by O0 optimization level. The passes will be
/// inserted after the inlining pass. /// inserted after the inlining pass.

View File

@ -202,6 +202,7 @@ void PassManagerBuilder::populateModulePassManager(PassManagerBase &MPM) {
if (OptLevel > 1) if (OptLevel > 1)
MPM.add(createConstantMergePass()); // Merge dup global constants MPM.add(createConstantMergePass()); // Merge dup global constants
} }
addExtensionsToPM(EP_OptimizerLast, MPM);
} }
void PassManagerBuilder::populateLTOPassManager(PassManagerBase &PM, void PassManagerBuilder::populateLTOPassManager(PassManagerBase &PM,