isl_basic_map_eliminate_vars: remove all dependent vars first
authorSven Verdoolaege <skimo@kotnet.org>
Sat, 28 Feb 2009 14:16:44 +0000 (15:16 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Fri, 20 Mar 2009 14:21:03 +0000 (15:21 +0100)
isl_map_simplify.c

index 0920d8a..ae58079 100644 (file)
@@ -1069,9 +1069,11 @@ struct isl_basic_map *isl_basic_map_eliminate_vars(
        total = isl_basic_map_total_dim(bmap);
 
        bmap = isl_basic_map_cow(bmap);
+       for (d = pos + n - 1; d >= 0 && d >= pos; --d)
+               bmap = remove_dependent_vars(bmap, d);
+
        for (d = pos + n - 1; d >= 0 && d >= pos; --d) {
                int n_lower, n_upper;
-               bmap = remove_dependent_vars(bmap, d);
                if (!bmap)
                        return NULL;
                if (d >= total - bmap->n_div)