isl_map.c: find_later_constraint_in_pair: stop search after near hit
authorSven Verdoolaege <sven@cerebras.net>
Wed, 17 Nov 2021 11:52:23 +0000 (17 12:52 +0100)
committerSven Verdoolaege <sven@cerebras.net>
Sun, 25 Feb 2024 14:55:44 +0000 (25 15:55 +0100)
If an opposite constraint is found that does not satisfy the bound,
then no opposite constraint satisfying the bound will be found
as otherwise the constraint found first would have been removed already.

Signed-off-by: Sven Verdoolaege <sven@cerebras.net>
isl_map.c

index 92a004d..9a7b0c8 100644 (file)
--- a/isl_map.c
+++ b/isl_map.c
@@ -2366,6 +2366,7 @@ static isl_size find_later_constraint_in_pair(__isl_keep isl_basic_map *bmap,
                        continue;
                if (constraint_pair_has_bound(bmap, ineq, j, bound, tmp))
                        return j;
+               return n_ineq;
        }
 
        return n_ineq;