From: David Majnemer Date: Thu, 28 Jul 2016 03:28:43 +0000 (+0000) Subject: Add EP_CGSCCOptimizerLate extension point to PassManagerBuilder X-Git-Tag: llvmorg-4.0.0-rc1~13998 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6e9b47bc8a52bc6a42fede54d385804700218f25;p=platform%2Fupstream%2Fllvm.git Add EP_CGSCCOptimizerLate extension point to PassManagerBuilder 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 --- diff --git a/llvm/include/llvm/Transforms/IPO/PassManagerBuilder.h b/llvm/include/llvm/Transforms/IPO/PassManagerBuilder.h index 841fce0..adc4179 100644 --- a/llvm/include/llvm/Transforms/IPO/PassManagerBuilder.h +++ b/llvm/include/llvm/Transforms/IPO/PassManagerBuilder.h @@ -100,6 +100,11 @@ public: /// 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. diff --git a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp index ec3973e..99fb422 100644 --- a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp +++ b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp @@ -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