Index: llvm/trunk/include/llvm/Transforms/IPO/PassManagerBuilder.h =================================================================== --- llvm/trunk/include/llvm/Transforms/IPO/PassManagerBuilder.h +++ llvm/trunk/include/llvm/Transforms/IPO/PassManagerBuilder.h @@ -100,6 +100,11 @@ /// 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. Index: llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp =================================================================== --- llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp +++ llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp @@ -440,6 +440,7 @@ 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