isl_basic_map_remove: only drop divs if basic map did not turn out to be empty
authorSven Verdoolaege <skimo@kotnet.org>
Fri, 28 Aug 2009 17:40:58 +0000 (19:40 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Fri, 28 Aug 2009 17:40:58 +0000 (19:40 +0200)
If isl_basic_map_eliminate_vars finds that its argument is empty,
it resets its constraints to the canonical representation of an empty
set and drops all divs.

isl_map.c

index 648b4b0..11d3ea5 100644 (file)
--- a/isl_map.c
+++ b/isl_map.c
@@ -1193,6 +1193,10 @@ struct isl_basic_map *isl_basic_map_remove(struct isl_basic_map *bmap,
                return bmap;
        bmap = isl_basic_map_eliminate_vars(bmap,
                        isl_basic_map_offset(bmap, type) - 1 + first, n);
+       if (!bmap)
+               return bmap;
+       if (ISL_F_ISSET(bmap, ISL_BASIC_MAP_EMPTY) && type == isl_dim_div)
+               return bmap;
        bmap = isl_basic_map_drop(bmap, type, first, n);
        return bmap;
 error: