Skip to content

Commit

Permalink
Add EP_CGSCCOptimizerLate extension point to PassManagerBuilder
Browse files Browse the repository at this point in the history
The EP_CGSCCOptimizerLate extension point allows adding CallGraphSCC
passes at the end of the main CallGraphSCC passes and before any
function simplification passes run by CGPassManager.

Patch by Gor Nishanov!

Differential Revision: https://reviews.llvm.org/D22897

llvm-svn: 276953
  • Loading branch information
majnemer committed Jul 28, 2016
1 parent 0be7155 commit 6e9b47b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions llvm/include/llvm/Transforms/IPO/PassManagerBuilder.h
Expand Up @@ -100,6 +100,11 @@ class PassManagerBuilder {
/// peephole optimizations similar to the instruction combiner. These passes
/// will be inserted after each instance of the instruction combiner pass.
EP_Peephole,

/// EP_CGSCCOptimizerLate - This extension point allows adding CallGraphSCC
/// passes at the end of the main CallGraphSCC passes and before any
/// function simplification passes run by CGPassManager.
EP_CGSCCOptimizerLate,
};

/// The Optimization Level - Specify the basic optimization level.
Expand Down
1 change: 1 addition & 0 deletions llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
Expand Up @@ -440,6 +440,7 @@ void PassManagerBuilder::populateModulePassManager(
if (OptLevel > 2)
MPM.add(createArgumentPromotionPass()); // Scalarize uninlined fn args

addExtensionsToPM(EP_CGSCCOptimizerLate, MPM);
addFunctionSimplificationPasses(MPM);

// FIXME: This is a HACK! The inliner pass above implicitly creates a CGSCC
Expand Down

0 comments on commit 6e9b47b

Please sign in to comment.