From 1463963058b56a59270f825e9a04891d7f250106 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Sun, 27 Jun 2010 19:00:35 +0200 Subject: [PATCH] isl_basic_map_from_constraint: keep all divs, even redundant ones When this function is called by CLooG, it assumes that the position of the divs will remain the same. If the redundant divs are removed, then this may not be the case. We should probably try to come up with a more robust interface. --- isl_constraint.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/isl_constraint.c b/isl_constraint.c index 96a088c9..27d790ae 100644 --- a/isl_constraint.c +++ b/isl_constraint.c @@ -389,6 +389,11 @@ int isl_constraint_is_equality(struct isl_constraint *constraint) return constraint->line >= constraint->bmap->eq; } +/* We manually set ISL_BASIC_SET_FINAL instead of calling + * isl_basic_map_finalize because we want to keep the position + * of the divs and we therefore do not want to throw away redundant divs. + * This is arguably a bit fragile. + */ __isl_give isl_basic_map *isl_basic_map_from_constraint( __isl_take isl_constraint *constraint) { @@ -425,7 +430,8 @@ __isl_give isl_basic_map *isl_basic_map_from_constraint( total = isl_basic_map_total_dim(bmap); isl_seq_cpy(c, constraint->line[0], 1 + total); isl_constraint_free(constraint); - bmap = isl_basic_map_finalize(bmap); + if (bmap) + ISL_F_SET(bmap, ISL_BASIC_SET_FINAL); return bmap; error: isl_constraint_free(constraint); -- 2.11.4.GIT