diff options
| author | Dan Gohman <gohman@apple.com> | 2012-01-17 20:51:32 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2012-01-17 20:51:32 +0000 |
| commit | b9936296d351abb80d7b9caf0de66ea85e19ac2b (patch) | |
| tree | 0f61b9c2d8c7d311305dbb86886bafb83bd1ef26 | |
| parent | 030b0d77ed950ebe11c79daec7c8c393cb8c7e5c (diff) | |
| download | bcm5719-llvm-b9936296d351abb80d7b9caf0de66ea85e19ac2b.tar.gz bcm5719-llvm-b9936296d351abb80d7b9caf0de66ea85e19ac2b.zip | |
Add a new PassManagerBuilder customization point,
EP_ModuleOptimizerEarly, to allow passes to be added before the
main ModulePass optimizers.
llvm-svn: 148329
| -rw-r--r-- | llvm/include/llvm/Transforms/IPO/PassManagerBuilder.h | 4 | ||||
| -rw-r--r-- | llvm/lib/Transforms/IPO/PassManagerBuilder.cpp | 2 |
2 files changed, 6 insertions, 0 deletions
diff --git a/llvm/include/llvm/Transforms/IPO/PassManagerBuilder.h b/llvm/include/llvm/Transforms/IPO/PassManagerBuilder.h index d265bdac496..b4ba1847816 100644 --- a/llvm/include/llvm/Transforms/IPO/PassManagerBuilder.h +++ b/llvm/include/llvm/Transforms/IPO/PassManagerBuilder.h @@ -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, diff --git a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp index f63f532101b..afd25dc317d 100644 --- a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp +++ b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp @@ -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 |

