From 97108501f83ce51e94dbe551168397ba57637c9a Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Fri, 14 Aug 2009 13:38:03 +0200 Subject: [PATCH] isl_basic_map_drop_redundant_divs: also investigate divs that have a definition They may have become redundant after having been defined. --- isl_map_simplify.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/isl_map_simplify.c b/isl_map_simplify.c index 65399abb..38981aaf 100644 --- a/isl_map_simplify.c +++ b/isl_map_simplify.c @@ -2277,9 +2277,9 @@ struct isl_basic_map *isl_basic_map_drop_redundant_divs( int pos, neg; int last_pos, last_neg; int redundant; + int defined; - if (!isl_int_is_zero(bmap->div[i][0])) - continue; + defined = !isl_int_is_zero(bmap->div[i][0]); for (j = 0; j < bmap->n_eq; ++j) if (!isl_int_is_zero(bmap->eq[j][1 + off + i])) break; @@ -2324,7 +2324,8 @@ struct isl_basic_map *isl_basic_map_drop_redundant_divs( isl_int_sub(bmap->ineq[last_pos][0], bmap->ineq[last_pos][0], bmap->ineq[last_neg][0]); if (!redundant) { - if (!ok_to_set_div_from_bound(bmap, i, last_pos)) { + if (defined || + !ok_to_set_div_from_bound(bmap, i, last_pos)) { pairs[i] = 0; --n; continue; -- 2.11.4.GIT