summaryrefslogtreecommitdiff
path: root/lib/Passes/PassBuilder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Passes/PassBuilder.cpp')
-rw-r--r--lib/Passes/PassBuilder.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Passes/PassBuilder.cpp b/lib/Passes/PassBuilder.cpp
index afd66f55720a..78d5ea955e64 100644
--- a/lib/Passes/PassBuilder.cpp
+++ b/lib/Passes/PassBuilder.cpp
@@ -464,10 +464,15 @@ static void addPGOInstrPasses(ModulePassManager &MPM, bool DebugLogging,
if (RunProfileGen) {
MPM.addPass(PGOInstrumentationGen());
+ FunctionPassManager FPM;
+ FPM.addPass(createFunctionToLoopPassAdaptor(LoopRotatePass()));
+ MPM.addPass(createModuleToFunctionPassAdaptor(std::move(FPM)));
+
// Add the profile lowering pass.
InstrProfOptions Options;
if (!ProfileGenFile.empty())
Options.InstrProfileOutput = ProfileGenFile;
+ Options.DoCounterPromotion = true;
MPM.addPass(InstrProfiling(Options));
}
@@ -923,9 +928,6 @@ ModulePassManager PassBuilder::buildLTODefaultPipeline(OptimizationLevel Level,
MainFPM.add(AlignmentFromAssumptionsPass());
#endif
- // FIXME: Conditionally run LoadCombine here, after it's ported
- // (in case we still have this pass, given its questionable usefulness).
-
// FIXME: add peephole extensions to the PM here.
MainFPM.addPass(InstCombinePass());
MainFPM.addPass(JumpThreadingPass());