[llvm] [nfc] Clarify when the various PGO instrumentation passes run (PR #92330)
Mircea Trofin via llvm-commits
llvm-commits at lists.llvm.org
Thu May 16 12:12:19 PDT 2024
================
@@ -1145,29 +1145,41 @@ PassBuilder::buildModuleSimplificationPipeline(OptimizationLevel Level,
MPM.addPass(createModuleToFunctionPassAdaptor(std::move(GlobalCleanupPM),
PTO.EagerlyInvalidateAnalyses));
- // Invoke the pre-inliner passes for instrumentation PGO or MemProf.
- if (PGOOpt && Phase != ThinOrFullLTOPhase::ThinLTOPostLink &&
- (PGOOpt->Action == PGOOptions::IRInstr ||
- PGOOpt->Action == PGOOptions::IRUse || !PGOOpt->MemoryProfile.empty()))
+ const bool IsPreLink = Phase != ThinOrFullLTOPhase::ThinLTOPostLink;
+ const bool IsPGOPreLink = PGOOpt && IsPreLink;
+ const bool IsPGOInstrGen =
+ IsPGOPreLink && PGOOpt->Action == PGOOptions::IRInstr;
+ const bool IsPGOInstrUse =
+ IsPGOPreLink && PGOOpt->Action == PGOOptions::IRUse;
+ const bool IsMemprof = IsPGOPreLink && !PGOOpt->MemoryProfile.empty();
----------------
mtrofin wrote:
Done
https://github.com/llvm/llvm-project/pull/92330
More information about the llvm-commits
mailing list