Skip to content

Commit f5f04a5

Browse files
committed
[Pipelines] Use isLTOPreLink() helper in more places (NFC)
1 parent 721a914 commit f5f04a5

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

llvm/lib/Passes/PassBuilderPipelines.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -990,8 +990,7 @@ PassBuilder::buildModuleSimplificationPipeline(OptimizationLevel Level,
990990
MPM.addPass(RequireAnalysisPass<ProfileSummaryAnalysis, Module>());
991991
// Do not invoke ICP in the LTOPrelink phase as it makes it hard
992992
// for the profile annotation to be accurate in the LTO backend.
993-
if (Phase != ThinOrFullLTOPhase::ThinLTOPreLink &&
994-
Phase != ThinOrFullLTOPhase::FullLTOPreLink)
993+
if (!isLTOPreLink(Phase))
995994
// We perform early indirect call promotion here, before globalopt.
996995
// This is important for the ThinLTO backend phase because otherwise
997996
// imported available_externally functions look unreferenced and are
@@ -1024,8 +1023,7 @@ PassBuilder::buildModuleSimplificationPipeline(OptimizationLevel Level,
10241023
IPSCCPOptions(/*AllowFuncSpec=*/
10251024
Level != OptimizationLevel::Os &&
10261025
Level != OptimizationLevel::Oz &&
1027-
Phase != ThinOrFullLTOPhase::ThinLTOPreLink &&
1028-
Phase != ThinOrFullLTOPhase::FullLTOPreLink)));
1026+
!isLTOPreLink(Phase))));
10291027

10301028
// Attach metadata to indirect call sites indicating the set of functions
10311029
// they may target at run-time. This should follow IPSCCP.
@@ -1234,8 +1232,7 @@ void PassBuilder::addVectorPasses(OptimizationLevel Level,
12341232
ModulePassManager
12351233
PassBuilder::buildModuleOptimizationPipeline(OptimizationLevel Level,
12361234
ThinOrFullLTOPhase LTOPhase) {
1237-
const bool LTOPreLink = (LTOPhase == ThinOrFullLTOPhase::ThinLTOPreLink ||
1238-
LTOPhase == ThinOrFullLTOPhase::FullLTOPreLink);
1235+
const bool LTOPreLink = isLTOPreLink(LTOPhase);
12391236
ModulePassManager MPM;
12401237

12411238
// Run partial inlining pass to partially inline functions that have

0 commit comments

Comments
 (0)