[𝘀𝗽𝗿] changes to main this commit is based on
Created using spr 1.3.4
[skip ci]
diff --git a/llvm/lib/Passes/PassBuilderPipelines.cpp b/llvm/lib/Passes/PassBuilderPipelines.cpp
index 4632a0e..6ca2f90 100644
--- a/llvm/lib/Passes/PassBuilderPipelines.cpp
+++ b/llvm/lib/Passes/PassBuilderPipelines.cpp
@@ -411,6 +411,12 @@
Phase == ThinOrFullLTOPhase::FullLTOPreLink;
}
+// Helper to check if the current compilation phase is LTO backend
+static bool isLTOPostLink(ThinOrFullLTOPhase Phase) {
+ return Phase == ThinOrFullLTOPhase::ThinLTOPostLink ||
+ Phase == ThinOrFullLTOPhase::FullLTOPostLink;
+}
+
// Helper to wrap conditionally Coro passes.
static CoroConditionalWrapper buildCoroWrapper(ThinOrFullLTOPhase Phase) {
// TODO: Skip passes according to Phase.
@@ -1613,8 +1619,7 @@
MPM.addPass(MergeFunctionsPass());
if (PTO.CallGraphProfile && !LTOPreLink)
- MPM.addPass(CGProfilePass(LTOPhase == ThinOrFullLTOPhase::FullLTOPostLink ||
- LTOPhase == ThinOrFullLTOPhase::ThinLTOPostLink));
+ MPM.addPass(CGProfilePass(isLTOPostLink(LTOPhase)));
// RelLookupTableConverterPass runs later in LTO post-link pipeline.
if (!LTOPreLink)