[polly] [Polly] Honor 'scops' phase being disabled (PR #180380)
Michael Kruse via llvm-commits
llvm-commits at lists.llvm.org
Sat Feb 7 17:41:55 PST 2026
https://github.com/Meinersbur created https://github.com/llvm/llvm-project/pull/180380
`opt -passes=polly-custom<detect>`, or stopafter=detect would still run the ScopInfo analysis even though it should run when explicitly enabled or required by another phase.
>From 518448aa01284d98242f754ae064babb7675a0fd Mon Sep 17 00:00:00 2001
From: Michael Kruse <llvm-project at meinersbur.de>
Date: Sun, 8 Feb 2026 02:33:40 +0100
Subject: [PATCH] [Polly] Honor scops phase being disabled
`opt -passes=polly-custom<detect>`, or stopafter=detect would still run
the ScopInfo analysis even though it should run when explicitly enabled
or required by another phase.
---
polly/lib/Pass/PhaseManager.cpp | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/polly/lib/Pass/PhaseManager.cpp b/polly/lib/Pass/PhaseManager.cpp
index 330dfe8b1ef1e..5e716ebc91af2 100644
--- a/polly/lib/Pass/PhaseManager.cpp
+++ b/polly/lib/Pass/PhaseManager.cpp
@@ -128,6 +128,10 @@ class PhaseManager {
if (Opts.isPhaseEnabled(PassPhase::ViewScopsOnly))
ViewScops("scopsonly", true);
+ // Can't do anything after this without ScopInfo.
+ if (!Opts.isPhaseEnabled(PassPhase::ScopInfo))
+ return false;
+
// Phase: scops
AssumptionCache &AC = FAM.getResult<AssumptionAnalysis>(F);
const DataLayout &DL = F.getParent()->getDataLayout();
More information about the llvm-commits
mailing list