isl_map_coalesce: normalize shifted facet before wrapping
commit8408c6d0954b95b216923c0acfa1bf60f2d09a52
authorSven Verdoolaege <sven.verdoolaege@gmail.com>
Fri, 29 Jun 2018 20:30:56 +0000 (29 22:30 +0200)
committerSven Verdoolaege <sven.verdoolaege@gmail.com>
Fri, 29 Jun 2018 21:36:13 +0000 (29 23:36 +0200)
tree6679b1a0e9d34b808358de81a62dcfcf663a3ca2
parent2f7432eb2f5fa080ac77a16d1fa2015ba85b6931
isl_map_coalesce: normalize shifted facet before wrapping

Forms of coalescing involving wrapping are only applied
to integer sets.  Constraint normalization ensures that
for each constraint of an integer set, the coefficients
of the variables (i.e., ignoring the constant term)
have no common factor.
This means, in particular, that after shifting a facet
by one, the result is only parallel to some other facet
if it has all equal or all opposite coefficients
(and not some other multiple).

However, constraint normalization may not always get applied.
This happens in particular when hidden equality constraints
are discovered and these are used to perform the fangcheng
procedure (Gaussian elimination).
A shifted facet may then be equal to some multiple (> 1)
of some other facet and may therefore not be discovered
as being parallel to the other facet, breaking invariants,

Arguably, constraints should also get normalized during
the fangcheng procedure, but start by normalizing the facet
after shifting.

Reported-by: Andrei Lascu <alas.20073@gmail.com>
Signed-off-by: Sven Verdoolaege <sven.verdoolaege@gmail.com>
isl_coalesce.c
isl_test.c