summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--polly/lib/External/isl/isl_pw_templ.c2
-rw-r--r--polly/lib/External/isl/isl_schedule_tree.c9
-rw-r--r--polly/lib/External/isl/isl_test.c30
3 files changed, 37 insertions, 4 deletions
diff --git a/polly/lib/External/isl/isl_pw_templ.c b/polly/lib/External/isl/isl_pw_templ.c
index daf58fc876e..6583cd2cc39 100644
--- a/polly/lib/External/isl/isl_pw_templ.c
+++ b/polly/lib/External/isl/isl_pw_templ.c
@@ -144,7 +144,7 @@ __isl_give PW *FN(PW,alloc)(__isl_take isl_set *set, __isl_take EL *el)
{
PW *pw;
- if (!set || !el)
+ if (FN(PW,check_compatible_domain)(el, set) < 0)
goto error;
#ifdef HAS_TYPE
diff --git a/polly/lib/External/isl/isl_schedule_tree.c b/polly/lib/External/isl/isl_schedule_tree.c
index 4d80332f9be..1b92e86fe4c 100644
--- a/polly/lib/External/isl/isl_schedule_tree.c
+++ b/polly/lib/External/isl/isl_schedule_tree.c
@@ -1733,7 +1733,7 @@ static __isl_give isl_union_map *subtree_schedule_extend_from_children(
separate = n > 1 && (tree->type == isl_schedule_node_sequence ||
isl_options_get_schedule_separate_components(ctx));
- space = extract_space_from_filter_child(tree);
+ space = isl_space_params_alloc(ctx, 0);
umap = isl_union_map_empty(isl_space_copy(space));
space = isl_space_set_from_params(space);
@@ -1745,6 +1745,7 @@ static __isl_give isl_union_map *subtree_schedule_extend_from_children(
dim = isl_multi_val_dim(mv, isl_dim_set);
for (i = 0; i < n; ++i) {
+ isl_multi_val *mv_copy;
isl_union_pw_multi_aff *upma;
isl_union_map *umap_i;
isl_union_set *dom;
@@ -1760,8 +1761,10 @@ static __isl_give isl_union_map *subtree_schedule_extend_from_children(
mv = isl_multi_val_set_val(mv, 0, isl_val_copy(v));
v = isl_val_add_ui(v, 1);
}
- upma = isl_union_pw_multi_aff_multi_val_on_domain(dom,
- isl_multi_val_copy(mv));
+ mv_copy = isl_multi_val_copy(mv);
+ space = isl_union_set_get_space(dom);
+ mv_copy = isl_multi_val_align_params(mv_copy, space);
+ upma = isl_union_pw_multi_aff_multi_val_on_domain(dom, mv_copy);
umap_i = isl_union_map_from_union_pw_multi_aff(upma);
umap_i = isl_union_map_flat_range_product(
isl_union_map_copy(outer), umap_i);
diff --git a/polly/lib/External/isl/isl_test.c b/polly/lib/External/isl/isl_test.c
index a3dc545ad63..030634750c1 100644
--- a/polly/lib/External/isl/isl_test.c
+++ b/polly/lib/External/isl/isl_test.c
@@ -6832,6 +6832,35 @@ static int test_compute_divs(isl_ctx *ctx)
return 0;
}
+/* Check that isl_schedule_get_map is not confused by a schedule tree
+ * with divergent filter node parameters, as can result from a call
+ * to isl_schedule_intersect_domain.
+ */
+static int test_schedule_tree(isl_ctx *ctx)
+{
+ const char *str;
+ isl_union_set *uset;
+ isl_schedule *sched1, *sched2;
+ isl_union_map *umap;
+
+ uset = isl_union_set_read_from_str(ctx, "{ A[i] }");
+ sched1 = isl_schedule_from_domain(uset);
+ uset = isl_union_set_read_from_str(ctx, "{ B[] }");
+ sched2 = isl_schedule_from_domain(uset);
+
+ sched1 = isl_schedule_sequence(sched1, sched2);
+ str = "[n] -> { A[i] : 0 <= i < n; B[] }";
+ uset = isl_union_set_read_from_str(ctx, str);
+ sched1 = isl_schedule_intersect_domain(sched1, uset);
+ umap = isl_schedule_get_map(sched1);
+ isl_schedule_free(sched1);
+ isl_union_map_free(umap);
+ if (!umap)
+ return -1;
+
+ return 0;
+}
+
/* Check that the reaching domain elements and the prefix schedule
* at a leaf node are the same before and after grouping.
*/
@@ -7352,6 +7381,7 @@ struct {
{ "injective", &test_injective },
{ "schedule (whole component)", &test_schedule_whole },
{ "schedule (incremental)", &test_schedule_incremental },
+ { "schedule tree", &test_schedule_tree },
{ "schedule tree grouping", &test_schedule_tree_group },
{ "tile", &test_tile },
{ "union_pw", &test_union_pw },
OpenPOWER on IntegriCloud