From f5f04a52b5146d124d7dbda93aeba09e19bf8a44 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Tue, 11 Apr 2023 13:08:00 +0200 Subject: [PATCH] [Pipelines] Use isLTOPreLink() helper in more places (NFC) --- llvm/lib/Passes/PassBuilderPipelines.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/llvm/lib/Passes/PassBuilderPipelines.cpp b/llvm/lib/Passes/PassBuilderPipelines.cpp index 925bb4b..943823c 100644 --- a/llvm/lib/Passes/PassBuilderPipelines.cpp +++ b/llvm/lib/Passes/PassBuilderPipelines.cpp @@ -990,8 +990,7 @@ PassBuilder::buildModuleSimplificationPipeline(OptimizationLevel Level, MPM.addPass(RequireAnalysisPass()); // Do not invoke ICP in the LTOPrelink phase as it makes it hard // for the profile annotation to be accurate in the LTO backend. - if (Phase != ThinOrFullLTOPhase::ThinLTOPreLink && - Phase != ThinOrFullLTOPhase::FullLTOPreLink) + if (!isLTOPreLink(Phase)) // We perform early indirect call promotion here, before globalopt. // This is important for the ThinLTO backend phase because otherwise // imported available_externally functions look unreferenced and are @@ -1024,8 +1023,7 @@ PassBuilder::buildModuleSimplificationPipeline(OptimizationLevel Level, IPSCCPOptions(/*AllowFuncSpec=*/ Level != OptimizationLevel::Os && Level != OptimizationLevel::Oz && - Phase != ThinOrFullLTOPhase::ThinLTOPreLink && - Phase != ThinOrFullLTOPhase::FullLTOPreLink))); + !isLTOPreLink(Phase)))); // Attach metadata to indirect call sites indicating the set of functions // they may target at run-time. This should follow IPSCCP. @@ -1234,8 +1232,7 @@ void PassBuilder::addVectorPasses(OptimizationLevel Level, ModulePassManager PassBuilder::buildModuleOptimizationPipeline(OptimizationLevel Level, ThinOrFullLTOPhase LTOPhase) { - const bool LTOPreLink = (LTOPhase == ThinOrFullLTOPhase::ThinLTOPreLink || - LTOPhase == ThinOrFullLTOPhase::FullLTOPreLink); + const bool LTOPreLink = isLTOPreLink(LTOPhase); ModulePassManager MPM; // Run partial inlining pass to partially inline functions that have -- 2.7.4