isl_map_coalesce: harmonize integer divisions in stride constraints
commit0b4256f662853cbdb795ad73d71d55c40fa5d380
authorSven Verdoolaege <skimo@kotnet.org>
Tue, 4 Oct 2016 09:12:34 +0000 (4 11:12 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Mon, 19 Dec 2016 09:05:20 +0000 (19 10:05 +0100)
treedf9d8e08f71c5343177994c24dde94799424c6b0
parent5978e35308bc0011edf0d5ffe32e245a0316ff89
isl_map_coalesce: harmonize integer divisions in stride constraints

Commit 8eb322e (isl_map_coalesce: harmonize integer divisions that differ by
a constant, Mon Oct 13 22:54:29 2014 +0200) introduced support for
harmonizing integer divisions that only differ by an integer constant.
In a recent commit, this was extended to take into account
equality constraints, but the difference between the integer divisions
was still required to be an integer constant.

This commit also harmonizes some integer divisions that differ
by a rational constant.  In particular, an integer division
that is defined by a stride constraint can take on different
values for the constant term without affecting its meaning
(when combined with the stride constraint).
This commit changes those integer divisions to have a zero
constant term, harmonizing pairs of integer divisions that
originally differed only by a rational constant.

Harmonizing such integer divisions ensures that their
definition is kept when the disjuncts in which they appear
get fused.  This in turn increases the likelihood of the fused
disjunct getting coalesced with other disjuncts.

This harmonization process could be extended to constraints
that force a modulo expression to lie within certain integer bounds,
rather than being equated to a single integer.
It may not always be possible to change the constant term to a zero
in the case of a pair of bounds, but it may still be possible
to find a common constant term that can be used in both disjuncts.

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_coalesce.c