isl_map_coalesce: extend the handling of a pair adjacent inequalities
commit70abe446e835f53768f8f7e1631e75332d354058
authorSven Verdoolaege <skimo@kotnet.org>
Sat, 23 Mar 2013 14:55:02 +0000 (23 15:55 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Thu, 28 Mar 2013 18:11:32 +0000 (28 19:11 +0100)
tree17e8fcdf0d57a59f5603baa7890a5ab6c2941618
parent5255ef2cfd1cf8d6fa3ad2c1f900a5c0b6ff9a10
isl_map_coalesce: extend the handling of a pair adjacent inequalities

In particular, one of the adjacent inequalities may imply an equality
on the integer points in the corresponding set and this equality will
not be valid for the other set.
For example, the set

{ [x,y] : 0 <= x <= 2 and y >= 0 and x + 2y <= 4;
  [x,y] : 3 <= x <= 4 and y >= 0 and x + 2y <= 4 }

may be simplified to

{ [x,y] : 0 <= x <= 2 and y >= 0 and x + 2y <= 4;
  [x,0] : 3 <= x <= 4 }

and the equality y = 0 is not valid for the other component.
However, we may still be able to fuse in such cases if all the constraints
of the other component are valid for the component with the equality and if
we can show that replacing the adjacent inequality x <= 2 by its opposite
(x >= 3) and adding the valid constraints (x <= 4) of the component with
the equality results in a subset of this component.  Since it is also
a superset of this component (all its constraints are valid for the component),
we can fuse the two components by combining their valid constraints.

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