isl_map_coalesce: eliminate unit divs from wrapping constraints
commit2fadd1c821c5123f9dec380d65ade74bbbd937ee
authorSven Verdoolaege <sven@cerebras.net>
Thu, 13 Feb 2020 15:12:04 +0000 (13 16:12 +0100)
committerSven Verdoolaege <sven.verdoolaege@gmail.com>
Sat, 25 Apr 2020 15:29:19 +0000 (25 17:29 +0200)
treed2f142253b67665e46877bd52dcd2d548e5df2ad
parent5539e53f5b11c9289e0d8798d6df96c6d89ea08b
isl_map_coalesce: eliminate unit divs from wrapping constraints

This fixes a regression introduced in isl-0.18-43-g0b4256f662
(isl_map_coalesce: harmonize integer divisions in stride constraints,
Tue Oct 4 11:12:34 2016 +0200) in the sense that the newly added
test case would get coalesced before that commit, but not after
that commit.
The reason is that before that commit, the two disjuncts with
(different) integer divisions would get coalesced first.
Since the integer division expressions are not identical,
an unknown local variable would get added inside fuse and
an attempt would be made to recover an integer division expression
by simplifying the result.  The simplification would also
result in the elimination of all appearances of the integer division
with a unit coefficient.  If this integer division does not appear
with any other coefficient in any other constraint, then
it would get eliminated completely.
Since the above commit, the integer divisions get harmonized first,
meaning that they are the same when the disjuncts get fused and
no simplification is performed.  The remaining disjunct
is then seen as having a separating constraint.

Explicitly eliminate (pure) unit integer divisions from extra (wrapping)
constraints if no complete simplification is being performed
to recover the effect on these unit integer divisions.

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