isl_map_coalesce: fix stride constraint integer division harmonization
commit962d4ad04871dbe8b4ac449661269ae05d429da3
authorSven Verdoolaege <sven.verdoolaege@gmail.com>
Thu, 10 May 2018 17:02:49 +0000 (10 19:02 +0200)
committerSven Verdoolaege <sven.verdoolaege@gmail.com>
Fri, 11 May 2018 20:42:02 +0000 (11 22:42 +0200)
treeff103aa52f141cdcac1bb49e12feb619288bce46
parent2d3f03993503be8965edcfda27a506272548ba57
isl_map_coalesce: fix stride constraint integer division harmonization

Commit isl-0.18-43-g0b4256f662 (isl_map_coalesce: harmonize integer
divisions in stride constraints, Tue Oct 4 11:12:34 2016 +0200) introduced
a harmonization of integer divisions in stride constraints that
ends up getting used by the test case introduced in commit
isl-0.18-46-g5334f05998 (isl_basic_map_simplify: reduce coefficients
of integer divisions, Thu Jun 23 17:31:31 2016 +0200).
The final clearing of the constant term of the integer division
is, however, only valid if the integer division has been derived
directly from the equality constraint.

In the new test case, two disjuncts get combined first
that have the equality constraints from which the integer division
was derived replaced by a pair of inequality constraints.
However, the result still has another equality constraint that
could also be used to derive an expression for the integer division.
Since this expression is different, the clearing of the constant term
is not valid in this case.

Only perform the clearing of the constant if the equality constraint
is of the expected form.  Note that this clearing is not needed
for the test case introduced in isl-0.18-46-g5334f05998, even
though the equality constraint is of the expected form here.
Still, there may very well be other cases where this clearing
is required, so the clearing is still performed whenever possible.

Reported-by: Michael Kruse <MichaelKruse@meinersbur.de>
Signed-off-by: Sven Verdoolaege <sven.verdoolaege@gmail.com>
isl_coalesce.c
isl_constraint.c
isl_constraint_private.h
isl_local_space.c
isl_local_space_private.h
isl_test.c