[Polly] Update isl to isl-0.27-82-g38cf72a4 (#182786)

Update isl to include
https://repo.or.cz/isl.git/commit/38cf72a41b708475fc22dc9fc62c7caae1ac29f6
which fixes #179993. This changes some string representations of ISL
objects in tests which are updated.

Fixes #179993

Thanks @skimo-openhub for the fix and @thapgua for the bugreport.
This commit is contained in:
Michael Kruse 2026-02-23 01:09:36 +01:00 committed by GitHub
parent 648193e161
commit 8e8974e5eb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
19 changed files with 408 additions and 123 deletions

View File

@ -1 +1 @@
isl-0.27-78-gfc484e00
isl-0.27-82-g38cf72a4

View File

@ -747,7 +747,7 @@ static __isl_give isl_set *intersect_stride_constraint(__isl_take isl_set *set,
if (!build)
return isl_set_free(set);
if (!isl_ast_build_has_stride(build, build->depth))
if (!isl_ast_build_has_stride(build))
return set;
stride = isl_ast_build_get_stride_constraint(build);
@ -1344,7 +1344,7 @@ __isl_give isl_set *isl_ast_build_get_stride_constraint(
pos = build->depth;
if (!isl_ast_build_has_stride(build, pos))
if (!isl_ast_build_has_stride(build))
return isl_set_universe(isl_ast_build_get_space(build, 1));
stride = isl_ast_build_get_stride(build, pos);
@ -1384,7 +1384,7 @@ __isl_give isl_multi_aff *isl_ast_build_get_stride_expansion(
space = isl_space_map_from_set(space);
ma = isl_multi_aff_identity(space);
if (!isl_ast_build_has_stride(build, pos))
if (!isl_ast_build_has_stride(build))
return ma;
offset = isl_ast_build_get_offset(build, pos);
@ -1407,7 +1407,7 @@ __isl_give isl_ast_build *isl_ast_build_include_stride(
if (!build)
return NULL;
if (!isl_ast_build_has_stride(build, build->depth))
if (!isl_ast_build_has_stride(build))
return build;
build = isl_ast_build_cow(build);
if (!build)
@ -1927,14 +1927,16 @@ isl_bool isl_ast_build_aff_is_nonneg(__isl_keep isl_ast_build *build,
return empty;
}
/* Does the dimension at (internal) position "pos" have a non-trivial stride?
/* Does the dimension at the current depth have a non-trivial stride?
*/
isl_bool isl_ast_build_has_stride(__isl_keep isl_ast_build *build, int pos)
isl_bool isl_ast_build_has_stride(__isl_keep isl_ast_build *build)
{
isl_val *v;
isl_bool has_stride;
isl_size pos;
if (!build)
pos = isl_ast_build_get_depth(build);
if (pos < 0)
return isl_bool_error;
v = isl_vec_get_element_val(build->strides, pos);

View File

@ -283,7 +283,7 @@ __isl_give isl_union_map *isl_ast_build_substitute_values_union_map_domain(
isl_bool isl_ast_build_aff_is_nonneg(__isl_keep isl_ast_build *build,
__isl_keep isl_aff *aff);
isl_bool isl_ast_build_has_stride(__isl_keep isl_ast_build *build, int pos);
isl_bool isl_ast_build_has_stride(__isl_keep isl_ast_build *build);
__isl_give isl_aff *isl_ast_build_get_offset(__isl_keep isl_ast_build *build,
int pos);
__isl_give isl_val *isl_ast_build_get_stride(__isl_keep isl_ast_build *build,

View File

@ -431,7 +431,7 @@ static __isl_give isl_aff *lower_bound(__isl_keep isl_constraint *c,
aff = isl_constraint_get_bound(c, isl_dim_set, pos);
aff = isl_aff_ceil(aff);
if (isl_ast_build_has_stride(build, pos)) {
if (isl_ast_build_has_stride(build)) {
isl_aff *offset;
isl_val *stride;
@ -613,7 +613,7 @@ static __isl_give isl_pw_aff_list *lower_bounds(
list = isl_pw_aff_list_add(list, isl_pw_aff_from_aff(aff));
}
if (isl_ast_build_has_stride(build, pos))
if (isl_ast_build_has_stride(build))
list = remove_redundant_lower_bounds(list, build);
return list;
@ -725,7 +725,7 @@ static __isl_give isl_set *add_implied_guards(__isl_take isl_set *guard,
isl_set *dom, *set;
depth = isl_ast_build_get_depth(build);
has_stride = isl_ast_build_has_stride(build, depth);
has_stride = isl_ast_build_has_stride(build);
if (depth < 0 || has_stride < 0)
return isl_set_free(guard);
if (!has_stride && !degenerate)
@ -1049,7 +1049,7 @@ static __isl_give isl_ast_expr *for_inc(__isl_keep isl_ast_build *build)
return NULL;
ctx = isl_ast_build_get_ctx(build);
if (!isl_ast_build_has_stride(build, depth))
if (!isl_ast_build_has_stride(build))
return isl_ast_expr_alloc_int_si(ctx, 1);
v = isl_ast_build_get_stride(build, depth);
@ -1690,7 +1690,7 @@ static __isl_give isl_ast_graft *create_node(__isl_take isl_union_map *executed,
if (depth < 0)
build = isl_ast_build_free(build);
data.depth = depth;
if (!isl_ast_build_has_stride(build, data.depth))
if (!isl_ast_build_has_stride(build))
return create_node_scaled(executed, bounds, domain, build);
offset = isl_ast_build_get_offset(build, data.depth);
@ -2934,6 +2934,239 @@ static int compute_separate_domain(struct isl_codegen_domains *domains,
return 0;
}
/* Internal data structure for split_off_fixed_non_strided.
*
* "build" is a (possibly modified) copy of the build.
* "core" is part of the domain that is not split off.
* "fixed" collects basic sets that have a fixed value at the current depth
* and that may be split off.
* "split" collects basic sets that are split off.
* "stride" describes stride constraints satisfied by "core"
* (along with additional constraints on the outer dimensions).
*/
struct isl_split_fixed_data {
isl_ast_build *build;
isl_set *core;
isl_set *fixed;
isl_set *split;
isl_set *stride;
};
/* Initialize "split" for a domain with the given space.
*/
static void isl_split_fixed_init(struct isl_split_fixed_data *split,
__isl_keep isl_ast_build *build, __isl_take isl_space *space)
{
split->build = isl_ast_build_copy(build);
split->core = isl_set_empty(space);
split->fixed = isl_set_copy(split->core);
split->split = isl_set_copy(split->core);
split->stride = NULL;
}
/* Free all memory allocated for "split".
*/
static void isl_split_fixed_free(struct isl_split_fixed_data *split)
{
split->build = isl_ast_build_free(split->build);
split->core = isl_set_free(split->core);
split->fixed = isl_set_free(split->fixed);
split->split = isl_set_free(split->split);
split->stride = isl_set_free(split->stride);
}
/* Add "bset" to either split->core or split->fixed depending
* on whether it has an obviously fixed value at the current depth.
*
* Only accept values that are directly defined by an equality constraint.
* Note that isl_map_plain_is_single_valued also considers cases
* of an equality constraint involving an integer division defined
* in terms of the current dimension.
* To prevent such cases from triggering, those integer divisions
* are first eliminated.
*/
static isl_stat split_fixed(__isl_take isl_basic_set *bset, void *user)
{
struct isl_split_fixed_data *split = user;
isl_set *set;
isl_map *map;
isl_bool sv;
set = isl_set_from_basic_set(bset);
map = isl_ast_build_map_to_iterator(split->build, isl_set_copy(set));
map = isl_map_remove_divs_involving_dims(map, isl_dim_out, 0, 1);
sv = isl_map_plain_is_single_valued(map);
isl_map_free(map);
if (sv < 0)
isl_set_free(set);
else if (sv)
split->fixed = isl_set_union(split->fixed, set);
else
split->core = isl_set_union(split->core, set);
return isl_stat_non_error_bool(sv);
}
/* Add "bset" to either split->core or split->split depending
* on whether it satisfies the stride constraints.
*/
static isl_stat split_not_strided(__isl_take isl_basic_set *bset, void *user)
{
struct isl_split_fixed_data *split = user;
isl_set *set;
isl_bool match;
set = isl_set_from_basic_set(bset);
match = isl_set_is_subset(set, split->stride);
if (match < 0)
isl_set_free(set);
else if (match)
split->core = isl_set_union(split->core, set);
else
split->split = isl_set_union(split->split, set);
return isl_stat_non_error_bool(match);
}
/* Is part of "domain" strided while the remainder has a fixed value
* for the current dimension?
*
* First, split off the basic sets of "domain" that have a fixed value, and
* check if the remainder satisfies some stride constraints.
*
* If so, see if any of the basic sets with a fixed value also
* satisfy these stride constraints. If so, add them to the core
* strided domain.
* Also include the shared constraints on the outer dimensions
* to these constraints so that a basic set with a fixed value
* that happens to be equal to one of the possible values in the strided domain,
* but does not otherwise fit in the strided domain, is not added
* to this domain.
*
* The remaining basic sets are collected in split->split.
* If there are any left, then return isl_bool_true.
*/
static isl_bool isl_split_fixed_need_split(struct isl_split_fixed_data *split,
__isl_keep isl_set *domain)
{
isl_size n1, n2, n3;
isl_bool has_stride;
isl_basic_set *outer;
isl_map *map;
if (isl_set_foreach_basic_set(domain, &split_fixed, split) < 0)
return isl_bool_error;
n1 = isl_set_n_basic_set(split->fixed);
n2 = isl_set_n_basic_set(split->core);
if (n1 < 0 || n2 < 0)
return isl_bool_error;
if (n1 == 0 || n2 == 0)
return isl_bool_false;
split->build = isl_ast_build_detect_strides(split->build,
isl_set_copy(split->core));
has_stride = isl_ast_build_has_stride(split->build);
if (has_stride < 0)
return isl_bool_error;
if (!has_stride)
return isl_bool_false;
split->stride = isl_ast_build_get_stride_constraint(split->build);
map = isl_ast_build_map_to_iterator(split->build,
isl_set_copy(split->core));
outer = isl_set_plain_unshifted_simple_hull(isl_map_domain(map));
split->stride =
isl_set_intersect(split->stride, isl_set_from_basic_set(outer));
if (isl_set_foreach_basic_set(split->fixed,
&split_not_strided, split) < 0)
return isl_bool_error;
n3 = isl_set_n_basic_set(split->split);
if (n3 < 0)
return isl_bool_error;
return isl_bool_ok(n3 > 0);
}
/* If part of "domain" is strided and the remainder has
* a fixed value for the current dimension, then subtract
* the second part from the first.
*
* There need to be at least two basic sets for one to be strided and
* one to have a fixed value.
* Furthermore, some local variables need to be involved
* for some basic sets to be strided.
*
* If this is the case, initialize the isl_split_fixed_data data structure,
* check whether a split is needed, and, if so, perform the split.
*/
static __isl_give isl_set *split_off_fixed_non_strided(
__isl_keep isl_ast_build *build, __isl_take isl_set *domain)
{
isl_bool locals, need;
isl_size n;
struct isl_split_fixed_data split;
n = isl_set_n_basic_set(domain);
if (n < 0)
return isl_set_free(domain);
if (n <= 1)
return domain;
locals = isl_set_involves_locals(domain);
if (locals < 0)
return isl_set_free(domain);
if (!locals)
return domain;
isl_split_fixed_init(&split, build, isl_set_get_space(domain));
need = isl_split_fixed_need_split(&split, domain);
if (need < 0) {
domain = isl_set_free(domain);
} else if (need) {
isl_set_free(domain);
domain = isl_set_copy(split.core);
domain = isl_set_subtract(domain, isl_set_copy(split.split));
domain = isl_set_union(domain, isl_set_copy(split.split));
}
isl_split_fixed_free(&split);
return domain;
}
/* Eliminate dimensions inner to the current dimension as well as
* existentially quantified variables and local variables
* that depend on the current dimension.
* The result then consists only of constraints that are independent
* of the current dimension and upper and lower bounds on the current
* dimension.
* Do this as a preparation for splitting up the domain into disjoint
* basic sets.
*
* If some parts of the domain satisfy some stride constraints,
* while the other parts have a fixed value for the current dimension,
* then first subtract this second part from the first.
* This is especially useful when the second part overlaps with
* the start or the end of the strided domain.
* In such cases it is usually better to generate code for this fixed value
* separately. Explicitly subtracting it here avoids situations
* where the first part is subtracted from the second, leading to
* more complicated code inside the (larger) strided domain.
*/
static __isl_give isl_set *compute_domains_eliminate(
__isl_keep isl_ast_build *build, __isl_take isl_set *domain)
{
domain = isl_ast_build_eliminate_inner(build, domain);
domain = split_off_fixed_non_strided(build, domain);
domain = isl_ast_build_eliminate_divs(build, domain);
return domain;
}
/* Split up the domain at the current depth into disjoint
* basic sets for which code should be generated separately
* for the given separation class domain.
@ -2995,7 +3228,7 @@ static isl_stat compute_partial_domains(struct isl_codegen_domains *domains,
domain = isl_set_intersect(domain,
isl_set_copy(domains->schedule_domain));
domain = isl_ast_build_eliminate(domains->build, domain);
domain = compute_domains_eliminate(domains->build, domain);
domain = isl_set_intersect(domain, isl_set_copy(class_domain));
domain = isl_set_coalesce_preserve(domain);
@ -3363,7 +3596,7 @@ static __isl_give isl_ast_graft_list *generate_shifted_component_tree_base(
return generate_shifted_component_tree_unroll(executed, domain,
build);
domain = isl_ast_build_eliminate(build, domain);
domain = compute_domains_eliminate(build, domain);
domain = isl_set_coalesce_preserve(domain);
outer_disjunction = has_pure_outer_disjunction(domain, build);

View File

@ -4202,6 +4202,7 @@ __isl_give isl_map *isl_map_coalesce(__isl_take isl_map *map)
struct isl_coalesce_info *info = NULL;
map = isl_map_remove_empty_parts(map);
map = isl_map_remove_obvious_duplicates(map);
if (!map)
return NULL;

View File

@ -484,6 +484,25 @@ static void test_box_hull(isl::ctx ctx)
});
}
/* Perform some coalescing tests.
*/
static void test_coalesce(isl::ctx ctx)
{
/* The following sequence can result in the same basic set
* appearing multiple times in the coalesced set.
* Check that the presence of such duplicates
* does not cause internal errors.
*/
isl::set a(ctx, "[g, t] -> { [i] : "
"(exists (e0 = floor((1 + g)/2): 2e0 = 1 + g and 0 < i <= -t)) "
"or (exists (e0 = floor((1 + g)/2): i = 0 and 2e0 = 1 + g)) }");
a = a.coalesce();
isl::set b (ctx, "[g, t] -> { [i] : "
"(exists (e0 = floor((g)/2): 2e0 = g and 0 < i <= -t)) or "
"(exists (e0 = floor((g)/2): i = 0 and 2e0 = g)) }");
b.unite(a).unite(a).coalesce();
}
/* Perform some basic intersection tests.
*/
static void test_intersect(isl::ctx ctx)
@ -967,6 +986,7 @@ static std::vector<std::pair<const char *, void (*)(isl::ctx)>> tests =
{ "preimage", &test_preimage },
{ "fixed power", &test_fixed_power },
{ "box hull", &test_box_hull },
{ "coalesce", &test_coalesce },
{ "intersect", &test_intersect },
{ "lexmin", &test_lexmin },
{ "gist", &test_gist },

View File

@ -1,25 +1,25 @@
for (int c0 = a1; c0 <= min(min(b1, a3 - 1), a2 - 1); c0 += 1)
s0(c0);
for (int c0 = a2; c0 <= min(a3 - 1, b2); c0 += 1) {
if (c0 >= a1 && b1 >= c0)
s0(c0);
for (int c0 = a2; c0 <= min(min(a1 - 1, a3 - 1), b2); c0 += 1)
s1(c0);
}
for (int c0 = max(max(a1, a2), b2 + 1); c0 <= min(b1, a3 - 1); c0 += 1)
s0(c0);
for (int c0 = a3; c0 <= b3; c0 += 1) {
if (c0 >= a1 && b1 >= c0)
s0(c0);
for (int c0 = a3; c0 <= min(a1 - 1, b3); c0 += 1) {
if (c0 >= a2 && b2 >= c0)
s1(c0);
s2(c0);
}
for (int c0 = max(max(a1, a3), b3 + 1); c0 <= min(b1, a2 - 1); c0 += 1)
s0(c0);
for (int c0 = max(max(a3, b3 + 1), a2); c0 <= b2; c0 += 1) {
if (c0 >= a1 && b1 >= c0)
s0(c0);
for (int c0 = max(max(a3, b3 + 1), a2); c0 <= min(a1 - 1, b2); c0 += 1)
s1(c0);
}
for (int c0 = max(max(max(max(a1, a3), b3 + 1), a2), b2 + 1); c0 <= b1; c0 += 1)
for (int c0 = a1; c0 <= b1; c0 += 1) {
s0(c0);
if (c0 >= a2 && b2 >= c0)
s1(c0);
if (c0 >= a3 && b3 >= c0)
s2(c0);
}
for (int c0 = max(max(a1, b1 + 1), a2); c0 <= min(a3 - 1, b2); c0 += 1)
s1(c0);
for (int c0 = max(max(a1, b1 + 1), a3); c0 <= b3; c0 += 1) {
if (c0 >= a2 && b2 >= c0)
s1(c0);
s2(c0);
}
for (int c0 = max(max(max(max(a1, b1 + 1), a3), b3 + 1), a2); c0 <= b2; c0 += 1)
s1(c0);

View File

@ -1,25 +1,25 @@
if (c2 >= d2 + 1) {
for (int c0 = a1; c0 <= b1; c0 += 1)
for (int c1_0 = c1; c1_0 <= d1; c1_0 += 1)
s0(c0, c1_0);
} else {
for (int c0 = a1; c0 <= min(b1, a2 - 1); c0 += 1)
for (int c1_0 = c1; c1_0 <= d1; c1_0 += 1)
s0(c0, c1_0);
for (int c0 = a2; c0 <= b2; c0 += 1) {
if (c0 >= a1 && b1 >= c0)
for (int c1_0 = c1; c1_0 <= min(d1, c2 - 1); c1_0 += 1)
s0(c0, c1_0);
for (int c1_0 = c2; c1_0 <= d2; c1_0 += 1) {
if (c0 >= a1 && b1 >= c0 && c1_0 >= c1 && d1 >= c1_0)
s0(c0, c1_0);
if (c1 >= d1 + 1) {
for (int c0 = a2; c0 <= b2; c0 += 1)
for (int c1_0 = c2; c1_0 <= d2; c1_0 += 1)
s1(c0, c1_0);
}
if (c0 >= a1 && b1 >= c0)
for (int c1_0 = max(c1, d2 + 1); c1_0 <= d1; c1_0 += 1)
s0(c0, c1_0);
}
for (int c0 = max(max(a1, a2), b2 + 1); c0 <= b1; c0 += 1)
for (int c1_0 = c1; c1_0 <= d1; c1_0 += 1)
} else {
for (int c0 = a2; c0 <= min(a1 - 1, b2); c0 += 1)
for (int c1_0 = c2; c1_0 <= d2; c1_0 += 1)
s1(c0, c1_0);
for (int c0 = a1; c0 <= b1; c0 += 1) {
if (c0 >= a2 && b2 >= c0)
for (int c1_0 = c2; c1_0 <= min(c1 - 1, d2); c1_0 += 1)
s1(c0, c1_0);
for (int c1_0 = c1; c1_0 <= d1; c1_0 += 1) {
s0(c0, c1_0);
if (c0 >= a2 && b2 >= c0 && c1_0 >= c2 && d2 >= c1_0)
s1(c0, c1_0);
}
if (c0 >= a2 && b2 >= c0)
for (int c1_0 = max(d1 + 1, c2); c1_0 <= d2; c1_0 += 1)
s1(c0, c1_0);
}
for (int c0 = max(max(a1, b1 + 1), a2); c0 <= b2; c0 += 1)
for (int c1_0 = c2; c1_0 <= d2; c1_0 += 1)
s1(c0, c1_0);
}

View File

@ -1,18 +1,18 @@
if (c2 >= d2 + 1) {
for (int c0 = a1; c0 <= b1; c0 += 1)
for (int c1_0 = c1; c1_0 <= d1; c1_0 += 1)
s0(c0, c1_0);
if (c1 >= d1 + 1) {
for (int c0 = a2; c0 <= b2; c0 += 1)
for (int c1_0 = c2; c1_0 <= d2; c1_0 += 1)
s1(c0, c1_0);
} else {
for (int c0 = a1; c0 <= min(b1, a2 - 1); c0 += 1)
for (int c1_0 = c1; c1_0 <= d1; c1_0 += 1)
s0(c0, c1_0);
for (int c0 = a2; c0 <= b2; c0 += 1) {
if (a1 >= c0 + 1) {
for (int c1_0 = c2; c1_0 <= d2; c1_0 += 1)
s1(c0, c1_0);
} else if (c0 >= b1 + 1) {
for (int c1_0 = c2; c1_0 <= d2; c1_0 += 1)
s1(c0, c1_0);
for (int c0 = a2; c0 <= min(a1 - 1, b2); c0 += 1)
for (int c1_0 = c2; c1_0 <= d2; c1_0 += 1)
s1(c0, c1_0);
for (int c0 = a1; c0 <= b1; c0 += 1) {
if (a2 >= c0 + 1) {
for (int c1_0 = c1; c1_0 <= d1; c1_0 += 1)
s0(c0, c1_0);
} else if (c0 >= b2 + 1) {
for (int c1_0 = c1; c1_0 <= d1; c1_0 += 1)
s0(c0, c1_0);
} else {
for (int c1_0 = c2; c1_0 <= min(c1 - 1, d2); c1_0 += 1)
s1(c0, c1_0);
@ -22,13 +22,13 @@ if (c2 >= d2 + 1) {
s0(c0, c1_0);
s1(c0, c1_0);
}
for (int c1_0 = max(max(c1, d1 + 1), c2); c1_0 <= d2; c1_0 += 1)
for (int c1_0 = max(d1 + 1, c2); c1_0 <= d2; c1_0 += 1)
s1(c0, c1_0);
for (int c1_0 = max(c1, d2 + 1); c1_0 <= d1; c1_0 += 1)
for (int c1_0 = max(max(c1, c2), d2 + 1); c1_0 <= d1; c1_0 += 1)
s0(c0, c1_0);
}
}
for (int c0 = max(max(a1, a2), b2 + 1); c0 <= b1; c0 += 1)
for (int c1_0 = c1; c1_0 <= d1; c1_0 += 1)
s0(c0, c1_0);
for (int c0 = max(max(a1, b1 + 1), a2); c0 <= b2; c0 += 1)
for (int c1_0 = c2; c1_0 <= d2; c1_0 += 1)
s1(c0, c1_0);
}

View File

@ -1,5 +1,5 @@
for (int c0 = 0; c0 <= 2; c0 += 1)
for (int c1 = max(max(0, -4 * b0 - 4 * c0 + 1), -2 * c0 + b0 / 2); c1 <= 1; c1 += 1) {
for (int c1 = max(max(0, b0 - 4 * c0 - 1), -4 * b0 - 4 * c0 + 1); c1 <= 1; c1 += 1) {
if (b0 >= 1 && 4 * c0 + c1 >= 1)
for (int c2 = 1; c2 <= 2; c2 += 1)
for (int c3 = 1; c3 <= 14; c3 += 1)

View File

@ -2,45 +2,74 @@ for (int c0 = 0; c0 <= 1; c0 += 1) {
for (int c2 = 0; c2 <= length; c2 += 32) {
if (length >= c2 + 1) {
for (int c3 = 0; c3 <= length; c3 += 32) {
if (c2 == 0)
for (int c6 = max(0, -c3 + 1); c6 <= min(31, length - c3); c6 += 1)
S_0(c0, 0, c3 + c6 - 1);
for (int c5 = max(0, -c2 + 1); c5 <= min(31, (c3 / 2) - c2 - 1); c5 += 1)
for (int c6 = 0; c6 <= min(31, length - c3); c6 += 1)
S_0(c0, c2 + c5, c3 + c6 - 1);
for (int c5 = max(max(0, -c2 + 1), (c3 / 2) - c2); c5 <= min(min(31, length - c2 - 1), (c3 / 2) - c2 + 15); c5 += 1) {
for (int c6 = max(0, -c3 + 1); c6 <= min(length - c3, 2 * c2 - c3 + 2 * c5 - 1); c6 += 1)
S_0(c0, c2 + c5, c3 + c6 - 1);
S_3(c0, 0, c2 + c5);
if (length >= 2 * c2 + 2 * c5)
S_0(c0, c2 + c5, 2 * c2 + 2 * c5 - 1);
for (int c6 = 2 * c2 - c3 + 2 * c5 + 1; c6 <= min(31, length - c3); c6 += 1)
S_0(c0, c2 + c5, c3 + c6 - 1);
}
for (int c5 = max(0, (c3 / 2) - c2 + 16); c5 <= min(31, length - c2 - 1); c5 += 1)
for (int c6 = max(0, -c3 + 1); c6 <= min(31, length - c3); c6 += 1)
S_0(c0, c2 + c5, c3 + c6 - 1);
if (length <= 15 && c2 == 0 && c3 == 0)
S_4(c0);
if (c3 >= 2 * c2 && 2 * c2 + 32 >= c3)
for (int c4 = 1; c4 <= min(min(31, length - 2), (c3 / 2) + 14); c4 += 1)
for (int c5 = max((c3 / 2) - c2, -c2 + c4 + 1); c5 <= min(length - c2 - 1, (c3 / 2) - c2 + 15); c5 += 1)
if (c3 >= 2 * c2 + 64) {
for (int c5 = 0; c5 <= 31; c5 += 1)
for (int c6 = 0; c6 <= min(31, length - c3); c6 += 1)
S_0(c0, c2 + c5, c3 + c6 - 1);
} else if (2 * c2 >= c3 + 32) {
for (int c5 = 0; c5 <= min(31, length - c2 - 1); c5 += 1)
for (int c6 = max(0, -c3 + 1); c6 <= min(31, length - c3); c6 += 1)
S_0(c0, c2 + c5, c3 + c6 - 1);
} else {
for (int c4 = 0; c4 <= min(min(31, length - 2), (c3 / 2) + 14); c4 += 1) {
if (c2 == 0 && c4 == 0)
for (int c6 = max(0, -c3 + 1); c6 <= min(31, length - c3); c6 += 1)
S_0(c0, 0, c3 + c6 - 1);
if (c3 == 2 * c2 + 32 && c4 == 0)
for (int c5 = max(0, -c2 + 1); c5 <= 15; c5 += 1)
for (int c6 = 0; c6 <= min(31, length - 2 * c2 - 32); c6 += 1)
S_0(c0, c2 + c5, 2 * c2 + c6 + 31);
for (int c5 = max((c3 / 2) - c2, -c2 + c4 + 1); c5 <= min(length - c2 - 1, (c3 / 2) - c2 + 15); c5 += 1) {
if (c4 == 0)
for (int c6 = max(0, -c3 + 1); c6 <= min(length - c3, 2 * c2 - c3 + 2 * c5 - 1); c6 += 1)
S_0(c0, c2 + c5, c3 + c6 - 1);
S_3(c0, c4, c2 + c5);
if (c4 == 0 && length >= 2 * c2 + 2 * c5)
S_0(c0, c2 + c5, 2 * c2 + 2 * c5 - 1);
if (c4 == 0)
for (int c6 = 2 * c2 - c3 + 2 * c5 + 1; c6 <= min(31, length - c3); c6 += 1)
S_0(c0, c2 + c5, c3 + c6 - 1);
}
if (c3 == 2 * c2 && c4 == 0) {
for (int c5 = 16; c5 <= min(31, length - c2 - 1); c5 += 1)
for (int c6 = max(0, -2 * c2 + 1); c6 <= min(31, length - 2 * c2); c6 += 1)
S_0(c0, c2 + c5, 2 * c2 + c6 - 1);
if (length <= 15 && c2 == 0)
S_4(c0);
}
}
if (length == 1 && c2 == 0 && c3 == 0) {
S_0(c0, 0, 0);
S_4(c0);
}
}
}
for (int c3 = max(2 * c2, -(length % 32) + length + 32); c3 <= min(2 * length - 2, 2 * c2 + 62); c3 += 32)
for (int c4 = 0; c4 <= min(31, length - 2); c4 += 1) {
for (int c5 = max((c3 / 2) - c2, -c2 + c4 + 1); c5 <= min(length - c2 - 1, (c3 / 2) - c2 + 15); c5 += 1)
if (length >= c2 + 16 && c2 + 31 >= length && 2 * c2 >= length + 1)
for (int c4 = 0; c4 <= 31; c4 += 1)
for (int c5 = 0; c5 <= 15; c5 += 1)
S_3(c0, c4, c2 + c5);
if (c3 + 30 >= 2 * length && c4 == 0)
}
if (length >= 1 && c2 + 31 >= length) {
if (c2 + 16 == length) {
S_4(c0);
} else if (c2 == length) {
S_4(c0);
} else if ((length - c2 + 15) % 16 <= 14 && length >= 2 * ((length - c2 + 15) % 16) + 3 && length % 16 == ((length - c2 + 15) % 16) + 1) {
for (int c4 = 0; c4 <= min(31, length - 2); c4 += 1) {
for (int c5 = max(-c2 + c4 + 1, -((length - c2 + 15) % 16) + length - c2 - 1); c5 < length - c2; c5 += 1)
S_3(c0, c4, c2 + c5);
if (c4 == 0)
S_4(c0);
}
if (c2 + 16 == length)
S_4(c0);
} else if (length >= 32) {
S_4(c0);
} else {
S_4(c0);
}
} else if (length >= c2 + 32) {
for (int c3 = max(2 * c2, ((-length + 1055) % 32) + length + 1); c3 <= 2 * c2 + 62; c3 += 32)
for (int c4 = 0; c4 <= 31; c4 += 1)
for (int c5 = (c3 / 2) - c2; c5 <= (c3 / 2) - c2 + 15; c5 += 1)
S_3(c0, c4, c2 + c5);
}
if (length == 0 && c2 == 0)
S_4(c0);
}
for (int c1 = 32; c1 < length - 1; c1 += 32)
for (int c2 = c1; c2 < length; c2 += 32)

View File

@ -74,21 +74,21 @@ return:
; CHECK-NEXT: Stmt_reduction_for
; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 1]
; CHECK-NEXT: [Start] -> { Stmt_reduction_for[i0, i1] -> MemRef_phi__phi[] };
; CHECK-NEXT: new: [Start] -> { Stmt_reduction_for[i0, i1] -> MemRef_A[i0] : -i0 < i1 <= 3 - Start; Stmt_reduction_for[1, 0] -> MemRef_A[1] : Start >= 4; Stmt_reduction_for[0, 0] -> MemRef_A[0] };
; CHECK-NEXT: new: [Start] -> { Stmt_reduction_for[i0, i1] -> MemRef_A[i0] : 0 < i1 <= 3 - Start; Stmt_reduction_for[1, 0] -> MemRef_A[1] : Start >= 5 or Start <= 4; Stmt_reduction_for[0, 0] -> MemRef_A[0] };
; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]
; CHECK-NEXT: [Start] -> { Stmt_reduction_for[i0, i1] -> MemRef_phi[] };
; CHECK-NEXT: new: [Start] -> { Stmt_reduction_for[i0, i1] -> MemRef_A[i0] : i0 <= i1 <= 3 - Start; Stmt_reduction_for[i0, 0] -> MemRef_A[i0] : i0 <= -4 + Start; Stmt_reduction_for[1, 0] -> MemRef_A[1] : Start <= 4 }
; CHECK-NEXT: new: [Start] -> { Stmt_reduction_for[i0, i1] -> MemRef_A[i0] : 0 < i1 <= 3 - Start; Stmt_reduction_for[1, 0] -> MemRef_A[1] : Start >= 5 or Start <= 4; Stmt_reduction_for[0, 0] -> MemRef_A[0] };
; CHECK-NEXT: Stmt_body
; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]
; CHECK-NEXT: [Start] -> { Stmt_body[i0, i1] -> MemRef_mul[] };
; CHECK-NEXT: new: [Start] -> { Stmt_body[i0, i1] -> MemRef_A[i0] : i0 <= i1 <= 3 - Start; Stmt_body[i0, 0] -> MemRef_A[i0] : i0 <= -4 + Start; Stmt_body[1, 0] -> MemRef_A[1] : Start <= 4 }
; CHECK-NEXT: new: [Start] -> { Stmt_body[i0, i1] -> MemRef_A[i0] : 0 < i1 <= 3 - Start; Stmt_body[1, 0] -> MemRef_A[1] : Start >= 5 or Start <= 4; Stmt_body[0, 0] -> MemRef_A[0] };
; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 1]
; CHECK-NEXT: [Start] -> { Stmt_body[i0, i1] -> MemRef_phi[] };
; CHECK-NEXT: new: [Start] -> { Stmt_body[i0, i1] -> MemRef_A[i0] : i0 <= 3 - Start and i1 <= 3 - Start; Stmt_body[i0, 0] -> MemRef_A[i0] : i0 >= 4 - Start };
; CHECK-NEXT: new: [Start] -> { Stmt_body[i0, i1] -> MemRef_A[i0] : 0 < i1 <= 3 - Start; Stmt_body[1, 0] -> MemRef_A[1] : Start >= 5 or Start <= 4; Stmt_body[0, 0] -> MemRef_A[0] };
; CHECK-NEXT: Stmt_reduction_inc
; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 1]
; CHECK-NEXT: [Start] -> { Stmt_reduction_inc[i0, i1] -> MemRef_mul[] };
; CHECK-NEXT: new: [Start] -> { Stmt_reduction_inc[i0, i1] -> MemRef_A[i0] : i0 <= 3 - Start and i1 <= 3 - Start; Stmt_reduction_inc[i0, 0] -> MemRef_A[i0] : i0 >= 4 - Start };
; CHECK-NEXT: new: [Start] -> { Stmt_reduction_inc[i0, i1] -> MemRef_A[i0] : 0 < i1 <= 3 - Start; Stmt_reduction_inc[1, 0] -> MemRef_A[1] : Start >= 5 or Start <= 4; Stmt_reduction_inc[0, 0] -> MemRef_A[0] };
; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]
; CHECK-NEXT: [Start] -> { Stmt_reduction_inc[i0, i1] -> MemRef_phi__phi[] };
; CHECK-NEXT: new: [Start] -> { Stmt_reduction_inc[i0, i1] -> MemRef_A[i0] : 0 < i1 <= 3 - Start; Stmt_reduction_inc[i0, 0] -> MemRef_A[i0] }

View File

@ -10,11 +10,11 @@
; Stmt_S1[i0, i1] -> Stmt_S2[i0, 0]
;
; CHECK: RAW dependences:
; CHECK-NEXT: { Stmt_S1[i0, 1023] -> Stmt_S2[i0, o1] : 0 <= i0 <= 1023 and 0 <= o1 <= 1023; Stmt_S1[i0, i1] -> Stmt_S2[i0, 0] : 0 <= i0 <= 1023 and 0 <= i1 <= 1022; Stmt_S2[i0, i1] -> Stmt_S3[i0] : 0 <= i0 <= 1023 and 0 <= i1 <= 1023; Stmt_S3[i0] -> Stmt_S0[1 + i0] : 0 <= i0 <= 1022; Stmt_S0[i0] -> Stmt_S1[i0, o1] : 0 <= i0 <= 1023 and 0 <= o1 <= 1023 }
; CHECK-NEXT: { Stmt_S1[i0, 1023] -> Stmt_S2[i0, o1] : 0 <= i0 <= 1023 and 0 < o1 <= 1023; Stmt_S1[i0, i1] -> Stmt_S2[i0, 0] : 0 <= i0 <= 1023 and 0 <= i1 <= 1023; Stmt_S2[i0, i1] -> Stmt_S3[i0] : 0 <= i0 <= 1023 and 0 <= i1 <= 1023; Stmt_S3[i0] -> Stmt_S0[1 + i0] : 0 <= i0 <= 1022; Stmt_S0[i0] -> Stmt_S1[i0, o1] : 0 <= i0 <= 1023 and 0 <= o1 <= 1023 }
; CHECK-NEXT: WAR dependences:
; CHECK-NEXT: { Stmt_S1[i0, 1023] -> Stmt_S2[i0, o1] : 0 <= i0 <= 1023 and 0 <= o1 <= 1023; Stmt_S1[i0, i1] -> Stmt_S2[i0, 0] : 0 <= i0 <= 1023 and 0 <= i1 <= 1022; Stmt_S2[i0, i1] -> Stmt_S3[i0] : 0 <= i0 <= 1023 and 0 <= i1 <= 1023; Stmt_S3[i0] -> Stmt_S0[1 + i0] : 0 <= i0 <= 1022; Stmt_S0[i0] -> Stmt_S1[i0, o1] : 0 <= i0 <= 1023 and 0 <= o1 <= 1023 }
; CHECK-NEXT: { Stmt_S1[i0, 1023] -> Stmt_S2[i0, o1] : 0 <= i0 <= 1023 and 0 < o1 <= 1023; Stmt_S1[i0, i1] -> Stmt_S2[i0, 0] : 0 <= i0 <= 1023 and 0 <= i1 <= 1023; Stmt_S2[i0, i1] -> Stmt_S3[i0] : 0 <= i0 <= 1023 and 0 <= i1 <= 1023; Stmt_S3[i0] -> Stmt_S0[1 + i0] : 0 <= i0 <= 1022; Stmt_S0[i0] -> Stmt_S1[i0, o1] : 0 <= i0 <= 1023 and 0 <= o1 <= 1023 }
; CHECK-NEXT: WAW dependences:
; CHECK-NEXT: { Stmt_S1[i0, 1023] -> Stmt_S2[i0, o1] : 0 <= i0 <= 1023 and 0 <= o1 <= 1023; Stmt_S1[i0, i1] -> Stmt_S2[i0, 0] : 0 <= i0 <= 1023 and 0 <= i1 <= 1022; Stmt_S2[i0, i1] -> Stmt_S3[i0] : 0 <= i0 <= 1023 and 0 <= i1 <= 1023; Stmt_S3[i0] -> Stmt_S0[1 + i0] : 0 <= i0 <= 1022; Stmt_S0[i0] -> Stmt_S1[i0, o1] : 0 <= i0 <= 1023 and 0 <= o1 <= 1023 }
; CHECK-NEXT: { Stmt_S1[i0, 1023] -> Stmt_S2[i0, o1] : 0 <= i0 <= 1023 and 0 < o1 <= 1023; Stmt_S1[i0, i1] -> Stmt_S2[i0, 0] : 0 <= i0 <= 1023 and 0 <= i1 <= 1023; Stmt_S2[i0, i1] -> Stmt_S3[i0] : 0 <= i0 <= 1023 and 0 <= i1 <= 1023; Stmt_S3[i0] -> Stmt_S0[1 + i0] : 0 <= i0 <= 1022; Stmt_S0[i0] -> Stmt_S1[i0, o1] : 0 <= i0 <= 1023 and 0 <= o1 <= 1023 }
; CHECK-NEXT: Reduction dependences:
; CHECK-NEXT: { Stmt_S1[i0, i1] -> Stmt_S1[i0, 1 + i1] : 0 <= i0 <= 1023 and 0 <= i1 <= 1022; Stmt_S2[i0, i1] -> Stmt_S2[i0, 1 + i1] : 0 <= i0 <= 1023 and 0 <= i1 <= 1022 }
;

View File

@ -4,7 +4,7 @@
; CHECK: Invariant Accesses: {
; CHECK: ReadAccess := [Reduction Type: NONE] [Scalar: 0]
; CHECK: [y, p_1_loaded_from_j] -> { Stmt_for_body[i0] -> MemRef_j[0] };
; CHECK: Execution Context: [y, p_1_loaded_from_j] -> { : }
; CHECK: Execution Context: [y, p_1_loaded_from_j] -> { : y < 0 or y >= 0 }
; CHECK: }
; CHECK: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]

View File

@ -12,7 +12,7 @@ target triple = "x86_64-unknown-linux-gnu"
; CHECK: Assumed Context:
; CHECK-NEXT: [tmp17, tmp21, tmp27, tmp31] -> { : }
; CHECK: Invalid Context:
; CHECK-NEXT: [tmp17, tmp21, tmp27, tmp31] -> { : (tmp27 = 3 and tmp31 <= 143) or (tmp17 < 0 and tmp21 < 0) or (tmp17 < 0 and tmp21 > 0) or (tmp17 > 0 and tmp21 < 0) or (tmp17 > 0 and tmp21 > 0) }
; CHECK-NEXT: [tmp17, tmp21, tmp27, tmp31] -> { : (tmp17 < 0 and tmp21 < 0) or (tmp17 < 0 and tmp21 > 0) or (tmp17 > 0 and tmp21 < 0) or (tmp17 > 0 and tmp21 > 0) or (tmp27 = 3 and tmp31 <= 143) }
;
; CHECK: Statements {
; CHECK-NEXT: Stmt_bb15

View File

@ -17,7 +17,7 @@
; CHECK-NEXT: Assumed Context:
; CHECK-NEXT: [tmp14, p_1] -> { : }
; CHECK-NEXT: Invalid Context:
; CHECK-NEXT: [tmp14, p_1] -> { : tmp14 > 0 and (p_1 <= -1152921504606846977 or tmp14 >= 1152921504606846977 or p_1 >= 1152921504606846977 - tmp14) }
; CHECK-NEXT: [tmp14, p_1] -> { : tmp14 > 0 and (tmp14 >= 1152921504606846977 or p_1 <= -1152921504606846977 or p_1 >= 1152921504606846977 - tmp14) }
; CHECK: p0: %tmp14
; CHECK-NEXT: p1: {0,+,(0 smax %tmp)}<%bb12>
; CHECK-NEXT: Arrays {

View File

@ -17,7 +17,7 @@
; CHECK-NEXT: Assumed Context:
; CHECK-NEXT: [tmp14, p_1] -> { : }
; CHECK-NEXT: Invalid Context:
; CHECK-NEXT: [tmp14, p_1] -> { : tmp14 > 0 and (p_1 <= -1152921504606846977 or tmp14 >= 1152921504606846977 or p_1 >= 1152921504606846977 - tmp14) }
; CHECK-NEXT: [tmp14, p_1] -> { : tmp14 > 0 and (tmp14 >= 1152921504606846977 or p_1 <= -1152921504606846977 or p_1 >= 1152921504606846977 - tmp14) }
; CHECK: p0: %tmp14
; CHECK-NEXT: p1: {0,+,(0 smax %tmp)}<%bb12>
; CHECK-NEXT: Arrays {

View File

@ -17,7 +17,7 @@
; CHECK-NEXT: Assumed Context:
; CHECK-NEXT: [tmp14, p_1] -> { : }
; CHECK-NEXT: Invalid Context:
; CHECK-NEXT: [tmp14, p_1] -> { : tmp14 > 0 and (p_1 <= -1152921504606846977 or tmp14 >= 1152921504606846977 or p_1 >= 1152921504606846977 - tmp14) }
; CHECK-NEXT: [tmp14, p_1] -> { : tmp14 > 0 and (tmp14 >= 1152921504606846977 or p_1 <= -1152921504606846977 or p_1 >= 1152921504606846977 - tmp14) }
; CHECK: p0: %tmp14
; CHECK-NEXT: p1: {0,+,(0 smax %tmp)}<%bb12>
; CHECK-NEXT: Arrays {

View File

@ -4,7 +4,7 @@
; to overflow. However (p + q) can, thus checks are needed.
;
; CHECK: Invalid Context:
; CHECK-NEXT: [r1, r2, q, p] -> { : r2 > r1 and (p <= -2147483649 - q or r2 >= 128 + r1 or p >= 2147483648 - q) }
; CHECK-NEXT: [r1, r2, q, p] -> { : r2 > r1 and (r2 >= 128 + r1 or p <= -2147483649 - q or p >= 2147483648 - q) }
;
; void wraps(int *A, int p, short q, char r1, char r2) {
; for (char i = r1; i < r2; i++)