isl_map_coalesce: detect constants in potential extension
commitccb9f33854ccdbb6f9a4c50afedf9380956ad14e
authorSven Verdoolaege <skimo@kotnet.org>
Tue, 21 Jun 2016 11:00:06 +0000 (21 13:00 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Mon, 19 Dec 2016 09:05:20 +0000 (19 10:05 +0100)
tree434aa34b531bb5e5534006970c5f809e57e9b2f7
parent11cfda655e6d981e87c00768644f9720738c9540
isl_map_coalesce: detect constants in potential extension

An extension may in some cases not be detected because
some variables are assumed to take on their whole rational
range, while in practice they may only attain a single
integer value.
For example, in the new test case

    { [a, b, c, d] : (-a + d) mod 64 = 0 and a <= 8 and b <= 1 and
    10 - a <= c <= 3 and d >= 5 and 9 - 64b <= d <= 70;
      [a, b = 1, c, d] : (-a + d) mod 64 = 0 and a <= 8 and c >= 4 and
    10 - a <= c <= 5 and 5 <= d <= 73 - c }

b can only attain the single value 1 in the first disjunct as well.
Without this knowledge, the second disjunct is not detected as
an extension of the first.  Looking for all hidden equality constraints
is rather expensive, but checking whether any given variable can
only attain a single integer value is relatively cheap.
Detect such fixed values to increase the chance of a potential
extension being detected as a subset of another disjunct.

This detection is also useful in connection with the recently
introduced detection of constants among expanded integer divisions.
If some integer divisions copied from another disjunct are determined
to only attain fixed values in a given disjunct, then the same fixed
values need to be detected when the other disjunct is modified
into its extension in order to be able to detect that the given
disjunct is indeed an extension of the other disjunct.

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