Many parts of isl assume that Gaussian elimination has been
applied to the equality constraints. In particular singleton_extract_point
makes this assumption. The input to singleton_extract_point
may have undergone parameter alignment. This parameter alignment
(ultimately performed by isl_basic_map_realign) therefore
needs to make sure the result preserves this property.
Reported-by: Tobias Grosser <tobias@grosser.es>
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
@@ -11090,7 +11090,8 @@ __isl_give isl_map *isl_map_flatten_range(__isl_take isl_map *map)
}
/* Reorder the dimensions of "bmap" according to the given dim_map
- * and set the dimension specification to "dim".
+ * and set the dimension specification to "dim" and
+ * perform Gaussian elimination on the result.
*/
__isl_give isl_basic_map *isl_basic_map_realign(__isl_take isl_basic_map *bmap,
__isl_take isl_space *dim, __isl_take struct isl_dim_map *dim_map)
@@ -11111,6 +11112,7 @@ __isl_give isl_basic_map *isl_basic_map_realign(__isl_take isl_basic_map *bmap,
res = isl_basic_map_add_constraints_dim_map(res, bmap, dim_map);
if (res)
res->flags = flags;
+ res = isl_basic_map_gauss(res, NULL);
res = isl_basic_map_finalize(res);
return res;
error:
@@ -2896,6 +2896,7 @@ struct {
"4e0 >= 58 + i0 - i1 and i0 >= 2 and i0 <= 511 and "
"4e0 >= -61 + i0 + i1)) or "
"(i1 <= 66 - i0 and i0 >= 2 and i1 >= 59 + i0) }", 1 },
+ { "[a, b] -> { : a = 0 and b = -1 }", "[b, a] -> { : b >= -10 }", 1 },
};
static int test_subset(isl_ctx *ctx)