Index: llvm/lib/Passes/PassBuilderPipelines.cpp =================================================================== --- llvm/lib/Passes/PassBuilderPipelines.cpp +++ llvm/lib/Passes/PassBuilderPipelines.cpp @@ -506,8 +506,7 @@ FPM.addPass( SimplifyCFGPass(SimplifyCFGOptions().convertSwitchRangeToICmp(true))); FPM.addPass(InstCombinePass()); - if (Level == OptimizationLevel::O3) - FPM.addPass(AggressiveInstCombinePass()); + FPM.addPass(AggressiveInstCombinePass()); if (EnableConstraintElimination) FPM.addPass(ConstraintEliminationPass()); @@ -1699,7 +1698,7 @@ // calls, etc, so let instcombine do this. FunctionPassManager PeepholeFPM; PeepholeFPM.addPass(InstCombinePass()); - if (Level == OptimizationLevel::O3) + if (Level.getSpeedupLevel() > 1) PeepholeFPM.addPass(AggressiveInstCombinePass()); invokePeepholeEPCallbacks(PeepholeFPM, Level); Index: llvm/test/Other/new-pm-defaults.ll =================================================================== --- llvm/test/Other/new-pm-defaults.ll +++ llvm/test/Other/new-pm-defaults.ll @@ -154,7 +154,7 @@ ; CHECK-O23SZ-NEXT: Invalidating analysis: LazyValueAnalysis ; CHECK-O-NEXT: Running pass: SimplifyCFGPass ; CHECK-O-NEXT: Running pass: InstCombinePass -; CHECK-O3-NEXT: AggressiveInstCombinePass +; CHECK-O23SZ-NEXT: Running pass: AggressiveInstCombinePass ; CHECK-O23SZ-NEXT: Running pass: ConstraintEliminationPass ; CHECK-O1-NEXT: Running pass: LibCallsShrinkWrapPass ; CHECK-O2-NEXT: Running pass: LibCallsShrinkWrapPass Index: llvm/test/Other/new-pm-lto-defaults.ll =================================================================== --- llvm/test/Other/new-pm-lto-defaults.ll +++ llvm/test/Other/new-pm-lto-defaults.ll @@ -70,7 +70,7 @@ ; CHECK-O23SZ-NEXT: Running pass: ConstantMergePass ; CHECK-O23SZ-NEXT: Running pass: DeadArgumentEliminationPass ; CHECK-O23SZ-NEXT: Running pass: InstCombinePass -; CHECK-O3-NEXT: Running pass: AggressiveInstCombinePass +; CHECK-O23SZ-NEXT: Running pass: AggressiveInstCombinePass ; CHECK-EP-Peephole-NEXT: Running pass: NoOpFunctionPass ; CHECK-O23SZ-NEXT: Running pass: ModuleInlinerWrapperPass ; CHECK-O23SZ-NEXT: Running analysis: InlineAdvisorAnalysis Index: llvm/test/Other/new-pm-thinlto-postlink-defaults.ll =================================================================== --- llvm/test/Other/new-pm-thinlto-postlink-defaults.ll +++ llvm/test/Other/new-pm-thinlto-postlink-defaults.ll @@ -101,7 +101,7 @@ ; CHECK-O23SZ-NEXT: Invalidating analysis: LazyValueAnalysis ; CHECK-O-NEXT: Running pass: SimplifyCFGPass ; CHECK-O-NEXT: Running pass: InstCombinePass -; CHECK-O3-NEXT: Running pass: AggressiveInstCombinePass +; CHECK-O23SZ-NEXT: Running pass: AggressiveInstCombinePass ; CHECK-O23SZ-NEXT: Running pass: ConstraintEliminationPass ; CHECK-O1-NEXT: Running pass: LibCallsShrinkWrapPass ; CHECK-O2-NEXT: Running pass: LibCallsShrinkWrapPass Index: llvm/test/Other/new-pm-thinlto-postlink-pgo-defaults.ll =================================================================== --- llvm/test/Other/new-pm-thinlto-postlink-pgo-defaults.ll +++ llvm/test/Other/new-pm-thinlto-postlink-pgo-defaults.ll @@ -90,7 +90,7 @@ ; CHECK-O23SZ-NEXT: Invalidating analysis: LazyValueAnalysis ; CHECK-O-NEXT: Running pass: SimplifyCFGPass ; CHECK-O-NEXT: Running pass: InstCombinePass -; CHECK-O3-NEXT: Running pass: AggressiveInstCombinePass +; CHECK-O23SZ-NEXT: Running pass: AggressiveInstCombinePass ; CHECK-O23SZ-NEXT: Running pass: ConstraintEliminationPass ; CHECK-O1-NEXT: Running pass: LibCallsShrinkWrapPass ; CHECK-O2-NEXT: Running pass: LibCallsShrinkWrapPass Index: llvm/test/Other/new-pm-thinlto-postlink-samplepgo-defaults.ll =================================================================== --- llvm/test/Other/new-pm-thinlto-postlink-samplepgo-defaults.ll +++ llvm/test/Other/new-pm-thinlto-postlink-samplepgo-defaults.ll @@ -97,7 +97,7 @@ ; CHECK-O23SZ-NEXT: Invalidating analysis: LazyValueAnalysis ; CHECK-O-NEXT: Running pass: SimplifyCFGPass ; CHECK-O-NEXT: Running pass: InstCombinePass -; CHECK-O3-NEXT: Running pass: AggressiveInstCombinePass +; CHECK-O23SZ-NEXT: Running pass: AggressiveInstCombinePass ; CHECK-O23SZ-NEXT: Running pass: ConstraintEliminationPass ; CHECK-O1-NEXT: Running pass: LibCallsShrinkWrapPass ; CHECK-O2-NEXT: Running pass: LibCallsShrinkWrapPass Index: llvm/test/Other/new-pm-thinlto-prelink-defaults.ll =================================================================== --- llvm/test/Other/new-pm-thinlto-prelink-defaults.ll +++ llvm/test/Other/new-pm-thinlto-prelink-defaults.ll @@ -99,7 +99,7 @@ ; CHECK-O23SZ-NEXT: Invalidating analysis: LazyValueAnalysis ; CHECK-O-NEXT: Running pass: SimplifyCFGPass ; CHECK-O-NEXT: Running pass: InstCombinePass -; CHECK-O3-NEXT: Running pass: AggressiveInstCombinePass +; CHECK-O23SZ-NEXT: Running pass: AggressiveInstCombinePass ; CHECK-O23SZ-NEXT: Running pass: ConstraintEliminationPass ; CHECK-O1-NEXT: Running pass: LibCallsShrinkWrapPass ; CHECK-O2-NEXT: Running pass: LibCallsShrinkWrapPass Index: llvm/test/Other/new-pm-thinlto-prelink-pgo-defaults.ll =================================================================== --- llvm/test/Other/new-pm-thinlto-prelink-pgo-defaults.ll +++ llvm/test/Other/new-pm-thinlto-prelink-pgo-defaults.ll @@ -124,7 +124,7 @@ ; CHECK-O-NEXT: Running analysis: BranchProbabilityAnalysis on foo ; CHECK-O-NEXT: Running analysis: LoopAnalysis on foo ; CHECK-O-NEXT: Running analysis: PostDominatorTreeAnalysis on foo -; CHECK-O3-NEXT: Running pass: AggressiveInstCombinePass +; CHECK-O23SZ-NEXT: Running pass: AggressiveInstCombinePass ; CHECK-O23SZ-NEXT: Running pass: ConstraintEliminationPass ; CHECK-O1-NEXT: Running pass: LibCallsShrinkWrapPass ; CHECK-O2-NEXT: Running pass: LibCallsShrinkWrapPass Index: llvm/test/Other/new-pm-thinlto-prelink-samplepgo-defaults.ll =================================================================== --- llvm/test/Other/new-pm-thinlto-prelink-samplepgo-defaults.ll +++ llvm/test/Other/new-pm-thinlto-prelink-samplepgo-defaults.ll @@ -92,7 +92,7 @@ ; CHECK-O23SZ-NEXT: Invalidating analysis: LazyValueAnalysis ; CHECK-O-NEXT: Running pass: SimplifyCFGPass ; CHECK-O-NEXT: Running pass: InstCombinePass -; CHECK-O3-NEXT: Running pass: AggressiveInstCombinePass +; CHECK-O23SZ-NEXT: Running pass: AggressiveInstCombinePass ; CHECK-O23SZ-NEXT: Running pass: ConstraintEliminationPass ; CHECK-O1-NEXT: Running pass: LibCallsShrinkWrapPass ; CHECK-O2-NEXT: Running pass: LibCallsShrinkWrapPass