[polly] [Polly] Distribute the innermost point loop of tile over its statements (PR #225844)

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 28 04:43:55 PDT 2026


================
@@ -548,6 +576,161 @@ ScheduleTreeOptimizer::applyTileBandOpt(isl::schedule_node Node) {
   return Node;
 }
 
+isl::schedule_node
+ScheduleTreeOptimizer::distributeInnermostLoop(isl::schedule_node Node,
+                                               const Dependences *D) {
+  // This runs within a quota of isl operations. Every isl result that is used
+  // in a condition, iterated over or dereferenced is checked for an error
+  // first; in that case the band is left as it is.
+  if (Node.is_null() || !isSimpleInnermostBand(Node))
+    return Node;
+
+  isl::union_set Domain = Node.get_domain();
+  if (Domain.is_null())
+    return Node;
----------------
Meinersbur wrote:

Null check does not need to be added everywhere. Here: If `Domain.is_null()` then `Domain.get_set_list()` will also return a null list (i.e. null propagates). Only operations that do not propagate null need a check peforhand. For instance, `for (isl::set Set : DomainList)` will fail on a null value; otherwise it could not distinguish an empty list.

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


More information about the llvm-commits mailing list