Fix a typo in isl_term_dup
[platform/upstream/isl.git] / isl_coalesce.c
index b99c7b5..531cbdc 100644 (file)
@@ -223,7 +223,7 @@ static int fuse(struct isl_map *map, int i, int j,
            ISL_F_ISSET(map->p[j], ISL_BASIC_MAP_RATIONAL))
                ISL_F_SET(fused, ISL_BASIC_MAP_RATIONAL);
 
-       fused_tab = isl_tab_from_basic_map(fused);
+       fused_tab = isl_tab_from_basic_map(fused, 0);
        if (isl_tab_detect_redundant(fused_tab) < 0)
                goto error;
 
@@ -711,13 +711,16 @@ static int wrap_in_facets(struct isl_map *map, int i, int j,
                set_is_redundant(tabs[i], map->p[i]->n_eq, cuts, n, k, 1);
 
                isl_seq_neg(bound->el, map->p[i]->ineq[cuts[k]], 1 + total);
-               if (add_wraps(wraps, map->p[i], tabs[i], bound->el, set) < 0)
+               if (!tabs[i]->empty &&
+                   add_wraps(wraps, map->p[i], tabs[i], bound->el, set) < 0)
                        goto error;
 
                set_is_redundant(tabs[i], map->p[i]->n_eq, cuts, n, k, 0);
                if (isl_tab_rollback(tabs[i], snap_i) < 0)
                        goto error;
 
+               if (tabs[i]->empty)
+                       break;
                if (!wraps->n_row)
                        break;
 
@@ -1242,7 +1245,7 @@ struct isl_map *isl_map_coalesce(struct isl_map *map)
 
        n = map->n;
        for (i = 0; i < map->n; ++i) {
-               tabs[i] = isl_tab_from_basic_map(map->p[i]);
+               tabs[i] = isl_tab_from_basic_map(map->p[i], 0);
                if (!tabs[i])
                        goto error;
                if (!ISL_F_ISSET(map->p[i], ISL_BASIC_MAP_NO_IMPLICIT))