isl_basic_set_compute_vertices: fix handling of lower-dimensional input
authorSven Verdoolaege <skimo@kotnet.org>
Fri, 16 Dec 2011 08:20:34 +0000 (09:20 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Fri, 16 Dec 2011 08:22:22 +0000 (09:22 +0100)
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 <tobias@grosser.es>
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_test.c
isl_vertices.c

index 215c014..e66f0c7 100644 (file)
@@ -21,6 +21,7 @@
 #include <isl_factorization.h>
 #include <isl/schedule.h>
 #include <isl_options_private.h>
+#include <isl/vertices.h>
 
 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)
index e7d849e..5a4f8e3 100644 (file)
@@ -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(