From 0c677e9d907d8f9575d201ec66985cda431b542c Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Fri, 16 Dec 2011 09:20:34 +0100 Subject: [PATCH] isl_basic_set_compute_vertices: fix handling of lower-dimensional input Support was broken by 9043b59 (explicitly differentiate between spaces of maps, sets and parameter sets, Thu Aug 25 19:21:05 2011 +0200). This fix should have gone in before that commit. Reported-by: Tobias Grosser Signed-off-by: Sven Verdoolaege --- isl_test.c | 20 ++++++++++++++++++++ isl_vertices.c | 6 ++---- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/isl_test.c b/isl_test.c index 215c014..e66f0c7 100644 --- a/isl_test.c +++ b/isl_test.c @@ -21,6 +21,7 @@ #include #include #include +#include static char *srcdir; @@ -2530,6 +2531,23 @@ int test_fixed(isl_ctx *ctx) return 0; } +int test_vertices(isl_ctx *ctx) +{ + const char *str; + isl_basic_set *bset; + isl_vertices *vertices; + + str = "{ A[t, i] : t = 12 and i >= 4 and i <= 12 }"; + bset = isl_basic_set_read_from_str(ctx, str); + vertices = isl_basic_set_compute_vertices(bset); + isl_basic_set_free(bset); + isl_vertices_free(vertices); + if (!vertices) + return -1; + + return 0; +} + int test_union_pw(isl_ctx *ctx) { int equal; @@ -2562,6 +2580,8 @@ int main() assert(srcdir); ctx = isl_ctx_alloc(); + if (test_vertices(ctx) < 0) + goto error; if (test_fixed(ctx) < 0) goto error; if (test_equal(ctx) < 0) diff --git a/isl_vertices.c b/isl_vertices.c index e7d849e..5a4f8e3 100644 --- a/isl_vertices.c +++ b/isl_vertices.c @@ -1362,10 +1362,8 @@ __isl_give isl_vertices *isl_morph_vertices(__isl_take isl_morph *morph, isl_assert(vertices->bset->ctx, vertices->ref == 1, goto error); param_morph = isl_morph_copy(morph); - param_morph = isl_morph_remove_dom_dims(param_morph, isl_dim_set, - 0, isl_morph_dom_dim(morph, isl_dim_set)); - param_morph = isl_morph_remove_ran_dims(param_morph, isl_dim_set, - 0, isl_morph_ran_dim(morph, isl_dim_set)); + param_morph = isl_morph_dom_params(param_morph); + param_morph = isl_morph_ran_params(param_morph); for (i = 0; i < vertices->n_vertices; ++i) { vertices->v[i].dom = isl_morph_basic_set( -- 2.7.4