From fbcc763acafab8b181a078430e7ddd4a3c87085e Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Sat, 2 May 2015 14:23:26 +0200 Subject: [PATCH] isl_qpolynomial_fold_fold_on_domain: eliminate obviously equal entries Such obviously equal entries are currently already being eliminated based on the sign of their difference, but in case of infinite values this is the result of a bug in the determination of the sign of a NaN. This bug will be fixed in the next commit, so we first need to introduce another way of eliminating duplicate infinite values. Signed-off-by: Sven Verdoolaege --- isl_fold.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/isl_fold.c b/isl_fold.c index 698030b2..25e784cd 100644 --- a/isl_fold.c +++ b/isl_fold.c @@ -438,7 +438,13 @@ __isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_fold_on_domain( for (i = 0; i < fold2->n; ++i) { for (j = n1 - 1; j >= 0; --j) { isl_qpolynomial *d; - int sgn; + int sgn, equal; + equal = isl_qpolynomial_plain_is_equal(res->qp[j], + fold2->qp[i]); + if (equal < 0) + goto error; + if (equal) + break; d = isl_qpolynomial_sub( isl_qpolynomial_copy(res->qp[j]), isl_qpolynomial_copy(fold2->qp[i])); -- 2.11.4.GIT