isl_map_fast_is_universe: also detect redundant representations of the universe
authorSven Verdoolaege <skimo@kotnet.org>
Sun, 25 Jul 2010 12:05:00 +0000 (14:05 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Fri, 30 Jul 2010 19:33:48 +0000 (21:33 +0200)
During printing, we don't want to print any constraints if the given
map contains the universe.

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_map.c

index e8edde5..6a21a87 100644 (file)
--- a/isl_map.c
+++ b/isl_map.c
@@ -5280,10 +5280,18 @@ int isl_basic_set_is_universe(struct isl_basic_set *bset)
 
 int isl_map_fast_is_universe(__isl_keep isl_map *map)
 {
+       int i;
+
        if (!map)
                return -1;
 
-       return map->n == 1 && isl_basic_map_is_universe(map->p[0]);
+       for (i = 0; i < map->n; ++i) {
+               int r = isl_basic_map_is_universe(map->p[i]);
+               if (r < 0 || r)
+                       return r;
+       }
+
+       return 0;
 }
 
 int isl_set_fast_is_universe(__isl_keep isl_set *set)