diff --git a/llvm/lib/Passes/PassBuilderPipelines.cpp b/llvm/lib/Passes/PassBuilderPipelines.cpp --- a/llvm/lib/Passes/PassBuilderPipelines.cpp +++ b/llvm/lib/Passes/PassBuilderPipelines.cpp @@ -968,14 +968,6 @@ if (Level == OptimizationLevel::O3) EarlyFPM.addPass(CallSiteSplittingPass()); - // In SamplePGO ThinLTO backend, we need instcombine before profile annotation - // to convert bitcast to direct calls so that they can be inlined during the - // profile annotation prepration step. - // More details about SamplePGO design can be found in: - // https://research.google.com/pubs/pub45290.html - // FIXME: revisit how SampleProfileLoad/Inliner/ICP is structured. - if (LoadSampleProfile) - EarlyFPM.addPass(InstCombinePass()); MPM.addPass(createModuleToFunctionPassAdaptor(std::move(EarlyFPM), PTO.EagerlyInvalidateAnalyses)); diff --git a/llvm/test/Other/new-pm-pgo.ll b/llvm/test/Other/new-pm-pgo.ll --- a/llvm/test/Other/new-pm-pgo.ll +++ b/llvm/test/Other/new-pm-pgo.ll @@ -24,7 +24,6 @@ ; SAMPLE_USE: Running pass: SimplifyCFGPass ; SAMPLE_USE: Running pass: SROAPass ; SAMPLE_USE: Running pass: EarlyCSEPass -; SAMPLE_USE_POST_LINK: Running pass: InstCombinePass ; SAMPLE_USE: Running pass: SampleProfileLoaderPass ; SAMPLE_USE_O: Running pass: PGOIndirectCallPromotion ; SAMPLE_USE_POST_LINK-NOT: Running pass: GlobalOptPass diff --git a/llvm/test/Other/new-pm-thinlto-postlink-samplepgo-defaults.ll b/llvm/test/Other/new-pm-thinlto-postlink-samplepgo-defaults.ll --- a/llvm/test/Other/new-pm-thinlto-postlink-samplepgo-defaults.ll +++ b/llvm/test/Other/new-pm-thinlto-postlink-samplepgo-defaults.ll @@ -44,18 +44,12 @@ ; CHECK-O-NEXT: Running pass: EarlyCSEPass ; CHECK-O-NEXT: Running analysis: TargetLibraryAnalysis ; CHECK-O3-NEXT: Running pass: CallSiteSplittingPass -; CHECK-O-NEXT: Running pass: InstCombinePass on foo -; CHECK-O-NEXT: Running analysis: OptimizationRemarkEmitterAnalysis on foo -; CHECK-O-NEXT: Running analysis: AAManager on foo -; CHECK-O-NEXT: Running analysis: BasicAA -; CHECK-O-NEXT: Running analysis: ScopedNoAliasAA -; CHECK-O-NEXT: Running analysis: TypeBasedAA -; CHECK-O-NEXT: Running analysis: OuterAnalysisManagerProxy ; CHECK-O-NEXT: Running pass: SampleProfileLoaderPass ; CHECK-O-NEXT: Running analysis: ProfileSummaryAnalysis ; CHECK-O-NEXT: Running analysis: CallGraphAnalysis ; CHECK-O-NEXT: Running pass: RequireAnalysisPass<{{.*}}ProfileSummaryAnalysis ; CHECK-O-NEXT: Running pass: PGOIndirectCallPromotion +; CHECK-O-NEXT: Running analysis: OptimizationRemarkEmitterAnalysis ; CHECK-O-NEXT: Running pass: OpenMPOptPass ; CHECK-O-NEXT: Running pass: LowerTypeTestsPass ; CHECK-O-NEXT: Running pass: IPSCCPPass @@ -64,6 +58,11 @@ ; CHECK-O-NEXT: Running pass: GlobalOptPass ; CHECK-O-NEXT: Running pass: PromotePass ; CHECK-O-NEXT: Running pass: InstCombinePass +; CHECK-O-NEXT: Running analysis: AAManager on foo +; CHECK-O-NEXT: Running analysis: BasicAA +; CHECK-O-NEXT: Running analysis: ScopedNoAliasAA +; CHECK-O-NEXT: Running analysis: TypeBasedAA +; CHECK-O-NEXT: Running analysis: OuterAnalysisManagerProxy ; CHECK-O-NEXT: Running analysis: BlockFrequencyAnalysis on foo ; These next two can appear in any order since they are accessed as parameters ; on the same call to BlockFrequencyInfo::calculate. diff --git a/llvm/test/Other/new-pm-thinlto-prelink-samplepgo-defaults.ll b/llvm/test/Other/new-pm-thinlto-prelink-samplepgo-defaults.ll --- a/llvm/test/Other/new-pm-thinlto-prelink-samplepgo-defaults.ll +++ b/llvm/test/Other/new-pm-thinlto-prelink-samplepgo-defaults.ll @@ -42,13 +42,6 @@ ; CHECK-O-NEXT: Running pass: EarlyCSEPass ; CHECK-O-NEXT: Running analysis: TargetLibraryAnalysis ; CHECK-O3-NEXT: Running pass: CallSiteSplittingPass -; CHECK-O-NEXT: Running pass: InstCombinePass on foo -; CHECK-O-NEXT: Running analysis: OptimizationRemarkEmitterAnalysis on foo -; CHECK-O-NEXT: Running analysis: AAManager on foo -; CHECK-O-NEXT: Running analysis: BasicAA -; CHECK-O-NEXT: Running analysis: ScopedNoAliasAA -; CHECK-O-NEXT: Running analysis: TypeBasedAA -; CHECK-O-NEXT: Running analysis: OuterAnalysisManagerProxy ; CHECK-O-NEXT: Running pass: SampleProfileLoaderPass ; CHECK-O-NEXT: Running analysis: ProfileSummaryAnalysis ; CHECK-O-NEXT: Running analysis: CallGraphAnalysis @@ -59,6 +52,12 @@ ; CHECK-O-NEXT: Running pass: GlobalOptPass ; CHECK-O-NEXT: Running pass: PromotePass ; CHECK-O-NEXT: Running pass: InstCombinePass +; CHECK-O-NEXT: Running analysis: OptimizationRemarkEmitterAnalysis on foo +; CHECK-O-NEXT: Running analysis: AAManager on foo +; CHECK-O-NEXT: Running analysis: BasicAA +; CHECK-O-NEXT: Running analysis: ScopedNoAliasAA +; CHECK-O-NEXT: Running analysis: TypeBasedAA +; CHECK-O-NEXT: Running analysis: OuterAnalysisManagerProxy ; CHECK-O-NEXT: Running analysis: BlockFrequencyAnalysis on foo ; These next two can appear in any order since they are accessed as parameters ; on the same call to BlockFrequencyInfo::calculate.