[polly] Bound ISL operations during DeLICM scalar collapsing (PR #203073)

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 13 04:21:44 PDT 2026


================
@@ -1334,7 +1370,13 @@ class DeLICMImpl final : public ZoneAlgorithm {
         POLLY_DEBUG(dbgs() << "Analyzing target access " << MA << "\n");
         if (collapseScalarsToStore(MA))
           Modified = true;
+        else if (MaxOpGuard.hasQuotaExceeded()) {
+          MaxOpQuotaExceeded = true;
+          break;
+        }
       }
+      if (MaxOpQuotaExceeded)
+        break;
----------------
Meinersbur wrote:

```suggestion

        // No further collapse can succeed to when quota use used up
        if (MaxOpGuard.hasQuotaExceeded()) 
          break;
      }
      if (MaxOpGuard.hasQuotaExceeded())
        break;
```


If you treat `MaxOpGuard.hasQuotaExceeded()` has a persistent state anyway, you don't need the temporary `MaxOpQuotaExceeded`. 

(there are methods to break two loops as once such as wrapping it into a lambda, but I don't see a clear preference of those)

https://github.com/llvm/llvm-project/pull/203073


More information about the llvm-commits mailing list