From 1be3f4afff27402f0fd1ed9715936a953204c675 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Tue, 19 Mar 2013 11:23:20 +0100 Subject: [PATCH] isl_basic_map_compute_divs: recursively remove parameter equalities The removal of explicit equalities among the parameters may uncover additional equalities. If so, we now recurse in parameter_compute_divs so that also these extra equalities are removed. This will be important for the next commit where we will try to compress the existentially quantified variables and this requires the absence of equalities among the parameters. Signed-off-by: Sven Verdoolaege --- isl_map.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/isl_map.c b/isl_map.c index 6eb1a1a..7b4f80e 100644 --- a/isl_map.c +++ b/isl_map.c @@ -6414,6 +6414,11 @@ static int first_parameter_equality(__isl_keep isl_basic_set *bset) * among the parameters by performing a variable compression on * the parameters. Afterward, an inverse transformation is performed * and the equalities among the parameters are inserted back in. + * + * The variable compression on the parameters may uncover additional + * equalities that were only implicit before. We therefore check + * if there are any new parameter equalities in the result and + * if so recurse. */ static struct isl_set *parameter_compute_divs(struct isl_basic_set *bset) { @@ -6454,7 +6459,13 @@ static struct isl_set *parameter_compute_divs(struct isl_basic_set *bset) } bset = basic_set_parameter_preimage(bset, T); - set = isl_basic_set_lexmin(bset); + i = first_parameter_equality(bset); + if (!bset) + set = NULL; + else if (i == bset->n_eq) + set = isl_basic_set_lexmin(bset); + else + set = parameter_compute_divs(bset); set = set_parameter_preimage(set, T2); set = set_append_equalities(set, eq); return set; -- 2.7.4