Add loop pass insertion point EP_LateLoopOptimizations

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

llvm-svn: 293067
This commit is contained in:
Krzysztof Parzyszek 2017-01-25 16:12:25 +00:00
parent 710e821ddc
commit 0fd6296b82
2 changed files with 10 additions and 0 deletions

View File

@ -101,6 +101,14 @@ public:
/// will be inserted after each instance of the instruction combiner pass.
EP_Peephole,
/// EP_LateLoopOptimizations - This extension point allows adding late loop
/// canonicalization and simplification passes. This is the last point in
/// the loop optimization pipeline before loop deletion. Each pass added
/// here must be an instance of LoopPass.
/// This is the place to add passes that can remove loops, such as target-
/// specific loop idiom recognition.
EP_LateLoopOptimizations,
/// 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.

View File

@ -316,7 +316,9 @@ void PassManagerBuilder::addFunctionSimplificationPasses(
addInstructionCombiningPass(MPM);
MPM.add(createIndVarSimplifyPass()); // Canonicalize indvars
MPM.add(createLoopIdiomPass()); // Recognize idioms like memset.
addExtensionsToPM(EP_LateLoopOptimizations, MPM);
MPM.add(createLoopDeletionPass()); // Delete dead loops
if (EnableLoopInterchange) {
MPM.add(createLoopInterchangePass()); // Interchange loops
MPM.add(createCFGSimplificationPass());