isl_basic_map_detect_equalities: properly handle empty basic sets
authorSven Verdoolaege <skimo@kotnet.org>
Tue, 2 Jun 2009 17:41:40 +0000 (19:41 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Sun, 7 Jun 2009 10:33:10 +0000 (12:33 +0200)
If we find out during the computation of the equalities in
the basic map that it was empty, then there is no point in
trying to add any equalities we may have found.

isl_affine_hull.c

index fbdcddf..f5907e1 100644 (file)
@@ -497,6 +497,10 @@ struct isl_basic_map *isl_basic_map_detect_equalities(
        hull = equalities_in_underlying_set(isl_basic_map_copy(bmap));
        if (!hull)
                goto error;
+       if (ISL_F_ISSET(hull, ISL_BASIC_SET_EMPTY)) {
+               isl_basic_set_free(hull);
+               return isl_basic_map_set_to_empty(bmap);
+       }
        bmap = isl_basic_map_extend_dim(bmap, isl_dim_copy(bmap->dim), 0,
                                        hull->n_eq, 0);
        for (i = 0; i < hull->n_eq; ++i) {