// 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
// 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;
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.