[polly] ac57c4a - [Polly] Update isl to isl-0.27-78-gfc484e00 (#180377)
via llvm-commits
llvm-commits at lists.llvm.org
Sat Feb 7 15:30:38 PST 2026
Author: Michael Kruse
Date: 2026-02-08T00:30:33+01:00
New Revision: ac57c4a7285a0f4d9707ec9c3be8c5b0ee1423ec
URL: https://github.com/llvm/llvm-project/commit/ac57c4a7285a0f4d9707ec9c3be8c5b0ee1423ec
DIFF: https://github.com/llvm/llvm-project/commit/ac57c4a7285a0f4d9707ec9c3be8c5b0ee1423ec.diff
LOG: [Polly] Update isl to isl-0.27-78-gfc484e00 (#180377)
Update isl to include
https://repo.or.cz/isl.git/commit/fc484e004200964f8f18249de1f510393ec924a9
which fixes #180000.
The isl update also fixes #34710 which had the same cause but with an
empty access domain (#180000 has an empty statement domain). Thus we
also revert 163cacb46960be4dd0d8562737bbf0ea97cb14ad which now only adds
unnecessary overhead.
A regression test has been added to isl which is why we do not add a
test in Polly.
Fixes: #180000
Thanks @skimo-openhub for the fix and @thapgua for the bugreport.
Added:
polly/lib/External/isl/test_inputs/codegen/polly2.c
polly/lib/External/isl/test_inputs/codegen/polly2.st
Modified:
polly/lib/CodeGen/IslNodeBuilder.cpp
polly/lib/External/isl/GIT_HEAD_ID
polly/lib/External/isl/isl_ast_codegen.c
Removed:
polly/test/CodeGen/empty_domain_in_context.ll
################################################################################
diff --git a/polly/lib/CodeGen/IslNodeBuilder.cpp b/polly/lib/CodeGen/IslNodeBuilder.cpp
index c286066032625..299c98b21d702 100644
--- a/polly/lib/CodeGen/IslNodeBuilder.cpp
+++ b/polly/lib/CodeGen/IslNodeBuilder.cpp
@@ -807,8 +807,6 @@ IslNodeBuilder::createNewAccesses(ScopStmt *Stmt,
// isl cannot generate an index expression for access-nothing accesses.
isl::set AccDomain = PWAccRel.domain();
- isl::set Context = S.getContext();
- AccDomain = AccDomain.intersect_params(Context);
if (AccDomain.is_empty())
continue;
diff --git a/polly/lib/External/isl/GIT_HEAD_ID b/polly/lib/External/isl/GIT_HEAD_ID
index eea7901528508..4b3a0dd01b24b 100644
--- a/polly/lib/External/isl/GIT_HEAD_ID
+++ b/polly/lib/External/isl/GIT_HEAD_ID
@@ -1 +1 @@
-isl-0.27-77-g99a07a03
+isl-0.27-78-gfc484e00
diff --git a/polly/lib/External/isl/isl_ast_codegen.c b/polly/lib/External/isl/isl_ast_codegen.c
index 8275827a874d6..11b09dc595480 100644
--- a/polly/lib/External/isl/isl_ast_codegen.c
+++ b/polly/lib/External/isl/isl_ast_codegen.c
@@ -149,17 +149,28 @@ static __isl_give isl_ast_graft *at_each_domain(__isl_take isl_ast_graft *graft,
static isl_stat add_domain(__isl_take isl_map *executed,
struct isl_generate_domain_data *data)
{
+ isl_bool disjoint;
isl_ast_build *build;
isl_ast_graft *graft;
isl_ast_graft_list *list;
- isl_set *guard, *pending;
+ isl_set *guard, *pending, *domain;
+
+ guard = isl_map_domain(isl_map_copy(executed));
+ guard = isl_set_compute_divs(guard);
+ domain = isl_ast_build_get_domain(data->build);
+ disjoint = isl_set_is_disjoint(guard, domain);
+ isl_set_free(domain);
+
+ if (disjoint < 0 || disjoint) {
+ isl_set_free(guard);
+ isl_map_free(executed);
+ return isl_stat_non_error_bool(disjoint);
+ }
build = isl_ast_build_copy(data->build);
pending = isl_ast_build_get_pending(build);
build = isl_ast_build_replace_pending_by_guard(build, pending);
- guard = isl_map_domain(isl_map_copy(executed));
- guard = isl_set_compute_divs(guard);
guard = isl_set_coalesce_preserve(guard);
guard = isl_set_gist(guard, isl_ast_build_get_generated(build));
guard = isl_ast_build_specialize(build, guard);
diff --git a/polly/lib/External/isl/test_inputs/codegen/polly2.c b/polly/lib/External/isl/test_inputs/codegen/polly2.c
new file mode 100644
index 0000000000000..6cf990c3ae216
--- /dev/null
+++ b/polly/lib/External/isl/test_inputs/codegen/polly2.c
@@ -0,0 +1,2 @@
+for (int c0 = 0; c0 <= 1; c0 += 1)
+ Stmt_for_body9_us94_last(c0);
diff --git a/polly/lib/External/isl/test_inputs/codegen/polly2.st b/polly/lib/External/isl/test_inputs/codegen/polly2.st
new file mode 100644
index 0000000000000..a8746e655ad22
--- /dev/null
+++ b/polly/lib/External/isl/test_inputs/codegen/polly2.st
@@ -0,0 +1,12 @@
+# A Polly generated test case that would cause a failure
+# to handle void expression in an earlier version of isl.
+domain: "[e] -> { Stmt_for_body9_us94_last[i0] : 0 <= i0 <= 1; Stmt_cond_false30_us97[i0] : e = 0 and 0 <= i0 <= 1 }"
+child:
+ context: "[e] -> { [] : (e > 0 and e <= 127) or (e >= -128 and e < 0) }"
+ child:
+ schedule: "[e] -> [{ Stmt_for_body9_us94_last[i0] -> [(i0)]; Stmt_cond_false30_us97[i0] -> [(i0)] }]"
+ child:
+ sequence:
+ - filter: "[e] -> { Stmt_for_body9_us94_last[i0] }"
+ - filter: "[e] -> { Stmt_cond_false30_us97[i0] }"
+
diff --git a/polly/test/CodeGen/empty_domain_in_context.ll b/polly/test/CodeGen/empty_domain_in_context.ll
deleted file mode 100644
index f6c39eb0517bc..0000000000000
--- a/polly/test/CodeGen/empty_domain_in_context.ll
+++ /dev/null
@@ -1,86 +0,0 @@
-; RUN: opt %loadNPMPolly '-passes=polly-custom<optree;opt-isl;codegen>' -S < %s | FileCheck %s
-;
-; llvm.org/PR35362
-; isl codegen does not allow to generate isl_ast_expr from pw_aff which have an
-; empty domain. This happens in this case because the pw_aff's domain is
-; excluded by the SCoP's parameter context.
-
-target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
-
- at c = external local_unnamed_addr global i8
- at a = external local_unnamed_addr global i16
- at b = external local_unnamed_addr global i8
-
-define void @fn1() {
-entry:
- %a.promoted = load i16, ptr @a
- br label %for.cond
-
-for.cond: ; preds = %for.cond3.for.end_crit_edge, %entry
- %inc.lcssa17 = phi i16 [ 0, %for.cond3.for.end_crit_edge ], [ %a.promoted, %entry ]
- br label %for.body
-
-for.body: ; preds = %for.cond
- %conv = zext i16 %inc.lcssa17 to i32
- %div = udiv i32 -286702568, %conv
- br i1 undef, label %if.end, label %if.then
-
-if.then: ; preds = %for.body
- unreachable
-
-if.end: ; preds = %for.body
- br label %for.body5.lr.ph
-
-for.body5.lr.ph: ; preds = %if.end
- %tmp = load i8, ptr @b, align 1
- %cmp = icmp eq i32 %div, 1
- br i1 %cmp, label %for.body5.lr.ph.split.us, label %for.body5.lr.ph.split
-
-for.body5.lr.ph.split.us: ; preds = %for.body5.lr.ph
- br label %lor.end.us.peel
-
-lor.end.us.peel: ; preds = %for.body5.lr.ph.split.us
- %inc.us.peel = add i16 %inc.lcssa17, 1
- br i1 false, label %for.cond3.for.end_crit_edge, label %for.body5.us.peel.next
-
-for.body5.us.peel.next: ; preds = %lor.end.us.peel
- br label %lor.end.us
-
-lor.end.us: ; preds = %lor.end.us, %for.body5.us.peel.next
- %tmp1 = phi i16 [ %inc.us.peel, %for.body5.us.peel.next ], [ %inc.us, %lor.end.us ]
- %inc.us = add i16 %tmp1, 1
- %tobool4.us = icmp eq i16 %inc.us, 0
- br i1 %tobool4.us, label %for.cond3.for.end_crit_edge, label %lor.end.us
-
-for.body5.lr.ph.split: ; preds = %for.body5.lr.ph
- br label %lor.end.peel
-
-lor.end.peel: ; preds = %for.body5.lr.ph.split
- %inc.peel = add i16 %inc.lcssa17, 1
- br i1 false, label %for.cond3.for.end_crit_edge, label %for.body5.peel.next
-
-for.body5.peel.next: ; preds = %lor.end.peel
- br label %lor.end
-
-lor.end: ; preds = %lor.end, %for.body5.peel.next
- %tmp2 = phi i16 [ %inc.peel, %for.body5.peel.next ], [ %inc, %lor.end ]
- %inc = add i16 %tmp2, 1
- %tobool4 = icmp eq i16 %inc, 0
- br i1 %tobool4, label %for.cond3.for.end_crit_edge, label %lor.end
-
-for.cond3.for.end_crit_edge: ; preds = %lor.end, %lor.end.peel, %lor.end.us, %lor.end.us.peel
- %tmp3 = phi i8 [ %tmp, %lor.end.us.peel ], [ %tmp, %lor.end.peel ], [ %tmp, %lor.end.us ], [ %tmp, %lor.end ]
- store i8 4, ptr @c
- br label %for.cond
-}
-
-
-; The reference to @b should have been generated from an isl_ast_expr.
-; Because isl is unable to generate it in this case, the code generator
-; resorted to use the pointer argument of %tmp = load ... .
-; It is not important since this code will never be executed.
-
-; CHECK: polly.stmt.lor.end.us.peel:
-; CHECK-NEXT: %tmp_p_scalar_2 = load i8, ptr @b
-; CHECK-NEXT: store i8 %tmp_p_scalar_2, ptr %tmp3.phiops
-; CHECK-NEXT: br label %polly.merge
More information about the llvm-commits
mailing list