@@ -990,8 +990,7 @@ PassBuilder::buildModuleSimplificationPipeline(OptimizationLevel Level,
990
990
MPM.addPass (RequireAnalysisPass<ProfileSummaryAnalysis, Module>());
991
991
// Do not invoke ICP in the LTOPrelink phase as it makes it hard
992
992
// for the profile annotation to be accurate in the LTO backend.
993
- if (Phase != ThinOrFullLTOPhase::ThinLTOPreLink &&
994
- Phase != ThinOrFullLTOPhase::FullLTOPreLink)
993
+ if (!isLTOPreLink (Phase))
995
994
// We perform early indirect call promotion here, before globalopt.
996
995
// This is important for the ThinLTO backend phase because otherwise
997
996
// imported available_externally functions look unreferenced and are
@@ -1024,8 +1023,7 @@ PassBuilder::buildModuleSimplificationPipeline(OptimizationLevel Level,
1024
1023
IPSCCPOptions (/* AllowFuncSpec=*/
1025
1024
Level != OptimizationLevel::Os &&
1026
1025
Level != OptimizationLevel::Oz &&
1027
- Phase != ThinOrFullLTOPhase::ThinLTOPreLink &&
1028
- Phase != ThinOrFullLTOPhase::FullLTOPreLink)));
1026
+ !isLTOPreLink (Phase))));
1029
1027
1030
1028
// Attach metadata to indirect call sites indicating the set of functions
1031
1029
// they may target at run-time. This should follow IPSCCP.
@@ -1234,8 +1232,7 @@ void PassBuilder::addVectorPasses(OptimizationLevel Level,
1234
1232
ModulePassManager
1235
1233
PassBuilder::buildModuleOptimizationPipeline (OptimizationLevel Level,
1236
1234
ThinOrFullLTOPhase LTOPhase) {
1237
- const bool LTOPreLink = (LTOPhase == ThinOrFullLTOPhase::ThinLTOPreLink ||
1238
- LTOPhase == ThinOrFullLTOPhase::FullLTOPreLink);
1235
+ const bool LTOPreLink = isLTOPreLink (LTOPhase);
1239
1236
ModulePassManager MPM;
1240
1237
1241
1238
// Run partial inlining pass to partially inline functions that have
0 commit comments