diff options
author | Sven Verdoolaege <skimo@kotnet.org> | 2010-11-15 11:39:19 +0100 |
---|---|---|
committer | Sven Verdoolaege <skimo@kotnet.org> | 2010-11-15 11:39:19 +0100 |
commit | da7076227b58bbaf5920dbfe9db9f44282f07792 (patch) | |
tree | 932dd921ef3734083377b47c1bd6392de589a4e5 | |
parent | 9b2d15d2366b8239d811a609f9510c2aa9def4e8 (diff) | |
download | isl-da7076227b58bbaf5920dbfe9db9f44282f07792.tar.gz isl-da7076227b58bbaf5920dbfe9db9f44282f07792.tar.bz2 isl-da7076227b58bbaf5920dbfe9db9f44282f07792.zip |
isl_basic_map_eliminate_vars: don't detect divs while removing duplicate constraints
We were careful to remove the definitions of divs that depend on the
eliminated variables at the start of isl_basic_map_eliminate_vars,
but remove_duplicate_constraints could rediscover some of them and
add them back in.
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
-rw-r--r-- | isl_map_simplify.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/isl_map_simplify.c b/isl_map_simplify.c index 2d1179ba..a596cd52 100644 --- a/isl_map_simplify.c +++ b/isl_map_simplify.c @@ -1015,7 +1015,7 @@ static struct isl_basic_map *check_for_div_constraints( } static struct isl_basic_map *remove_duplicate_constraints( - struct isl_basic_map *bmap, int *progress) + struct isl_basic_map *bmap, int *progress, int detect_divs) { unsigned int size; isl_int ***index; @@ -1058,8 +1058,9 @@ static struct isl_basic_map *remove_duplicate_constraints( l = index[h] - &bmap->ineq[0]; isl_int_add(sum, bmap->ineq[k][0], bmap->ineq[l][0]); if (isl_int_is_pos(sum)) { - bmap = check_for_div_constraints(bmap, k, l, sum, - progress); + if (detect_divs) + bmap = check_for_div_constraints(bmap, k, l, + sum, progress); continue; } if (isl_int_is_zero(sum)) { @@ -1097,7 +1098,7 @@ struct isl_basic_map *isl_basic_map_simplify(struct isl_basic_map *bmap) bmap = isl_basic_map_gauss(bmap, &progress); /* requires equalities in normal form */ bmap = normalize_divs(bmap, &progress); - bmap = remove_duplicate_constraints(bmap, &progress); + bmap = remove_duplicate_constraints(bmap, &progress, 1); } return bmap; } @@ -1340,7 +1341,7 @@ struct isl_basic_map *isl_basic_map_eliminate_vars( } if (n_lower > 0 && n_upper > 0) { bmap = isl_basic_map_normalize_constraints(bmap); - bmap = remove_duplicate_constraints(bmap, NULL); + bmap = remove_duplicate_constraints(bmap, NULL, 0); bmap = isl_basic_map_gauss(bmap, NULL); bmap = isl_basic_map_remove_redundancies(bmap); if (!bmap) |