[polly] [Polly] Consider the preconditions of the block of a user assumption (PR #226473)

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 28 05:40:25 PDT 2026


================
@@ -1464,6 +1464,11 @@ void ScopBuilder::addUserAssumptions(
 
     isl::set AssumptionInvalidDomain = AssumptionInvalidDomainMap[BB];
     bool HasPreconditions = !AssumptionInvalidDomain.is_empty();
+    // An assumption inside the SCoP only holds where its block is executed,
+    // i.e. it also relies on the preconditions of the domain of the block, such
+    // as those of the conditions that lead to it.
+    if (InScop && !BBInvalidDomain.is_empty())
+      HasPreconditions = true;
----------------
Meinersbur wrote:

```suggestion
    bool HasPreconditions = !AssumptionInvalidDomain.is_empty() || (InScop && !BBInvalidDomain.is_empty());
```

The comment refers to this commit, not to the current state of the repository: What does "also" refer to? I don't think we need a comment unless you would also explain the "!AssumptionInvalidDomain.is_empty()" condition. That was is actually described where "HasPreconditions" is used; consider updating the comment here.

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


More information about the llvm-commits mailing list