diff --git a/llvm/include/llvm/Passes/PassBuilder.h b/llvm/include/llvm/Passes/PassBuilder.h index f8252b958367..4aabd93dbaff 100644 --- a/llvm/include/llvm/Passes/PassBuilder.h +++ b/llvm/include/llvm/Passes/PassBuilder.h @@ -710,7 +710,7 @@ class PassBuilder { void addRequiredLTOPreLinkPasses(ModulePassManager &MPM); void addVectorPasses(OptimizationLevel Level, FunctionPassManager &FPM, - bool IsLTO); + bool IsFullLTO); static Optional> parsePipelineText(StringRef Text); diff --git a/llvm/include/llvm/Transforms/IPO/PassManagerBuilder.h b/llvm/include/llvm/Transforms/IPO/PassManagerBuilder.h index 46d9bee2e10f..4f941d26df4c 100644 --- a/llvm/include/llvm/Transforms/IPO/PassManagerBuilder.h +++ b/llvm/include/llvm/Transforms/IPO/PassManagerBuilder.h @@ -218,8 +218,8 @@ class PassManagerBuilder { void addLateLTOOptimizationPasses(legacy::PassManagerBase &PM); void addPGOInstrPasses(legacy::PassManagerBase &MPM, bool IsCS); void addFunctionSimplificationPasses(legacy::PassManagerBase &MPM); - void addVectorPasses(legacy::PassManagerBase &PM, bool IsLTO); - + void addVectorPasses(legacy::PassManagerBase &PM, bool IsFullLTO); + public: /// populateFunctionPassManager - This fills in the function pass manager, /// which is expected to be run on each function immediately as it is diff --git a/llvm/lib/Passes/PassBuilder.cpp b/llvm/lib/Passes/PassBuilder.cpp index 229fd453c896..4f401fd05e85 100644 --- a/llvm/lib/Passes/PassBuilder.cpp +++ b/llvm/lib/Passes/PassBuilder.cpp @@ -1198,11 +1198,11 @@ PassBuilder::buildModuleSimplificationPipeline(OptimizationLevel Level, /// TODO: Should LTO cause any differences to this set of passes? void PassBuilder::addVectorPasses(OptimizationLevel Level, - FunctionPassManager &FPM, bool IsLTO) { + FunctionPassManager &FPM, bool IsFullLTO) { FPM.addPass(LoopVectorizePass( LoopVectorizeOptions(!PTO.LoopInterleaving, !PTO.LoopVectorization))); - if (IsLTO) { + if (IsFullLTO) { // The vectorizer may have significantly shortened a loop body; unroll // again. Unroll small loops to hide loop backedge latency and saturate any // parallel execution resources of an out-of-order processor. We also then @@ -1220,7 +1220,7 @@ void PassBuilder::addVectorPasses(OptimizationLevel Level, FPM.addPass(WarnMissedTransformationsPass()); } - if (!IsLTO) { + if (!IsFullLTO) { // Eliminate loads by forwarding stores from the previous iteration to loads // of the current iteration. FPM.addPass(LoopLoadEliminationPass()); @@ -1267,7 +1267,7 @@ void PassBuilder::addVectorPasses(OptimizationLevel Level, .hoistCommonInsts(true) .sinkCommonInsts(true))); - if (IsLTO) { + if (IsFullLTO) { FPM.addPass(SCCPPass()); FPM.addPass(InstCombinePass()); FPM.addPass(BDCEPass()); @@ -1283,7 +1283,7 @@ void PassBuilder::addVectorPasses(OptimizationLevel Level, // Enhance/cleanup vector code. FPM.addPass(VectorCombinePass()); - if (!IsLTO) { + if (!IsFullLTO) { FPM.addPass(InstCombinePass()); // Unroll small loops to hide loop backedge latency and saturate any // parallel execution resources of an out-of-order processor. We also then @@ -1312,7 +1312,7 @@ void PassBuilder::addVectorPasses(OptimizationLevel Level, // alignment information, try to re-derive it here. FPM.addPass(AlignmentFromAssumptionsPass()); - if (IsLTO) + if (IsFullLTO) FPM.addPass(InstCombinePass()); } @@ -1410,7 +1410,7 @@ PassBuilder::buildModuleOptimizationPipeline(OptimizationLevel Level, // from the TargetLibraryInfo. OptimizePM.addPass(InjectTLIMappings()); - addVectorPasses(Level, OptimizePM, /* IsLTO */ false); + addVectorPasses(Level, OptimizePM, /* IsFullLTO */ false); // Split out cold code. Splitting is done late to avoid hiding context from // other optimizations and inadvertently regressing performance. The tradeoff @@ -1862,7 +1862,7 @@ PassBuilder::buildLTODefaultPipeline(OptimizationLevel Level, MainFPM.addPass(LoopDistributePass()); - addVectorPasses(Level, MainFPM, /* IsLTO */ true); + addVectorPasses(Level, MainFPM, /* IsFullLTO */ true); invokePeepholeEPCallbacks(MainFPM, Level); MainFPM.addPass(JumpThreadingPass(/*InsertFreezeWhenUnfoldingSelect*/ true)); diff --git a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp index 86fa0181f000..7f8ba79c99bd 100644 --- a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp +++ b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp @@ -531,10 +531,10 @@ void PassManagerBuilder::addFunctionSimplificationPasses( /// FIXME: Should LTO cause any differences to this set of passes? void PassManagerBuilder::addVectorPasses(legacy::PassManagerBase &PM, - bool IsLTO) { + bool IsFullLTO) { PM.add(createLoopVectorizePass(!LoopsInterleaved, !LoopVectorize)); - if (IsLTO) { + if (IsFullLTO) { // The vectorizer may have significantly shortened a loop body; unroll // again. Unroll small loops to hide loop backedge latency and saturate any // parallel execution resources of an out-of-order processor. We also then @@ -550,7 +550,7 @@ void PassManagerBuilder::addVectorPasses(legacy::PassManagerBase &PM, PM.add(createWarnMissedTransformationsPass()); } - if (!IsLTO) { + if (!IsFullLTO) { // Eliminate loads by forwarding stores from the previous iteration to loads // of the current iteration. PM.add(createLoopLoadEliminationPass()); @@ -590,7 +590,7 @@ void PassManagerBuilder::addVectorPasses(legacy::PassManagerBase &PM, .hoistCommonInsts(true) .sinkCommonInsts(true))); - if (IsLTO) { + if (IsFullLTO) { PM.add(createSCCPPass()); // Propagate exposed constants PM.add(createInstructionCombiningPass()); // Clean up again PM.add(createBitTrackingDCEPass()); @@ -606,7 +606,7 @@ void PassManagerBuilder::addVectorPasses(legacy::PassManagerBase &PM, // Enhance/cleanup vector code. PM.add(createVectorCombinePass()); - if (!IsLTO) { + if (!IsFullLTO) { addExtensionsToPM(EP_Peephole, PM); PM.add(createInstructionCombiningPass()); @@ -639,7 +639,7 @@ void PassManagerBuilder::addVectorPasses(legacy::PassManagerBase &PM, // about pointer alignments. PM.add(createAlignmentFromAssumptionsPass()); - if (IsLTO) + if (IsFullLTO) PM.add(createInstructionCombiningPass()); } @@ -918,7 +918,7 @@ void PassManagerBuilder::populateModulePassManager( // llvm.loop.distribute=true or when -enable-loop-distribute is specified. MPM.add(createLoopDistributePass()); - addVectorPasses(MPM, /* IsLTO */ false); + addVectorPasses(MPM, /* IsFullLTO */ false); // FIXME: We shouldn't bother with this anymore. MPM.add(createStripDeadPrototypesPass()); // Get rid of dead prototypes @@ -1133,7 +1133,7 @@ void PassManagerBuilder::addLTOOptimizationPasses(legacy::PassManagerBase &PM) { ForgetAllSCEVInLoopUnroll)); PM.add(createLoopDistributePass()); - addVectorPasses(PM, /* IsLTO */ true); + addVectorPasses(PM, /* IsFullLTO */ true); addExtensionsToPM(EP_Peephole, PM);