From 7fc6996f171ca08956c33e2e096eb6ce40f31a99 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Thu, 6 Sep 2012 14:35:55 +0200 Subject: [PATCH] isl_map_simplify.c: remove_duplicate_divs: preserve known divs As explained in the commit message of 22c210c (isl_basic_map_gauss: try not to remove any div definitions, Tue Sep 1 22:59:21 2009 +0200), we should preserve known divs during isl_basic_map_simplify. That commit only fixed the possible loss of known divs in isl_basic_map_gauss. Here we fix the same problem in remove_duplicate_divs. Signed-off-by: Sven Verdoolaege --- isl_map_simplify.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/isl_map_simplify.c b/isl_map_simplify.c index c209867..9897d80 100644 --- a/isl_map_simplify.c +++ b/isl_map_simplify.c @@ -715,6 +715,7 @@ static struct isl_basic_map *remove_duplicate_divs( unsigned total; struct isl_ctx *ctx; + bmap = isl_basic_map_order_divs(bmap); if (!bmap || bmap->n_div <= 1) return bmap; @@ -764,7 +765,7 @@ static struct isl_basic_map *remove_duplicate_divs( k = elim_for[l] - 1; isl_int_set_si(eq.data[1+total_var+k], -1); isl_int_set_si(eq.data[1+total_var+l], 1); - eliminate_div(bmap, eq.data, l, 0); + eliminate_div(bmap, eq.data, l, 1); isl_int_set_si(eq.data[1+total_var+k], 0); isl_int_set_si(eq.data[1+total_var+l], 0); } -- 2.7.4