[llvm] 18da681 - [NFC] Remove unnecessary function pass managers
Arthur Eubanks via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 25 10:03:31 PST 2022
Author: Arthur Eubanks
Date: 2022-02-25T10:03:17-08:00
New Revision: 18da6810347aa57f7d50562e4e131004344b9d28
URL: https://github.com/llvm/llvm-project/commit/18da6810347aa57f7d50562e4e131004344b9d28
DIFF: https://github.com/llvm/llvm-project/commit/18da6810347aa57f7d50562e4e131004344b9d28.diff
LOG: [NFC] Remove unnecessary function pass managers
Added:
Modified:
llvm/lib/Passes/PassBuilderPipelines.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Passes/PassBuilderPipelines.cpp b/llvm/lib/Passes/PassBuilderPipelines.cpp
index e838665eb9ce9..079b78434c10a 100644
--- a/llvm/lib/Passes/PassBuilderPipelines.cpp
+++ b/llvm/lib/Passes/PassBuilderPipelines.cpp
@@ -233,9 +233,7 @@ void PassBuilder::invokePeepholeEPCallbacks(FunctionPassManager &FPM,
// Helper to add AnnotationRemarksPass.
static void addAnnotationRemarksPass(ModulePassManager &MPM) {
- FunctionPassManager FPM;
- FPM.addPass(AnnotationRemarksPass());
- MPM.addPass(createModuleToFunctionPassAdaptor(std::move(FPM)));
+ MPM.addPass(createModuleToFunctionPassAdaptor(AnnotationRemarksPass()));
}
// Helper to check if the current compilation phase is preparing for LTO
@@ -663,13 +661,13 @@ void PassBuilder::addPGOInstrPasses(ModulePassManager &MPM,
// Perform PGO instrumentation.
MPM.addPass(PGOInstrumentationGen(IsCS));
- FunctionPassManager FPM;
// Disable header duplication in loop rotation at -Oz.
- FPM.addPass(createFunctionToLoopPassAdaptor(
- LoopRotatePass(Level != OptimizationLevel::Oz), /*UseMemorySSA=*/false,
- /*UseBlockFrequencyInfo=*/false));
- MPM.addPass(createModuleToFunctionPassAdaptor(std::move(FPM),
- PTO.EagerlyInvalidateAnalyses));
+ MPM.addPass(createModuleToFunctionPassAdaptor(
+ createFunctionToLoopPassAdaptor(
+ LoopRotatePass(Level != OptimizationLevel::Oz),
+ /*UseMemorySSA=*/false,
+ /*UseBlockFrequencyInfo=*/false),
+ PTO.EagerlyInvalidateAnalyses));
// Add the profile lowering pass.
InstrProfOptions Options;
@@ -1497,10 +1495,8 @@ PassBuilder::buildLTODefaultPipeline(OptimizationLevel Level,
MPM.addPass(InferFunctionAttrsPass());
if (Level.getSpeedupLevel() > 1) {
- FunctionPassManager EarlyFPM;
- EarlyFPM.addPass(CallSiteSplittingPass());
MPM.addPass(createModuleToFunctionPassAdaptor(
- std::move(EarlyFPM), PTO.EagerlyInvalidateAnalyses));
+ CallSiteSplittingPass(), PTO.EagerlyInvalidateAnalyses));
// Indirect call promotion. This should promote all the targets that are
// left by the earlier promotion pass that promotes intra-module targets.
More information about the llvm-commits
mailing list