isl_ast_build_expr_from_set_internal: only exploit individual earlier disjuncts
commit4d5654aff27bc520eab311d5f8b42ccceeeabeec
authorSven Verdoolaege <skimo@kotnet.org>
Thu, 12 Nov 2015 10:27:35 +0000 (12 11:27 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Thu, 12 Nov 2015 10:27:35 +0000 (12 11:27 +0100)
tree4112f005f92ebb4e8e71338c71f7c386a20c7d03
parent523938f00171c4284179eba5948c8919a6808b53
isl_ast_build_expr_from_set_internal: only exploit individual earlier disjuncts

Commit 3518765 (isl_ast_build_expr_from_set_internal: exploit earlier disjuncts,
Wed Apr 29 13:56:42 2015 +0200) introduced an optimization that removes
constraints from disjuncts that only serve to prevent overlap with
previous disjuncts.  However, in performing this optimization, set
differences are cumulatively computed, possibly resulting in
intermediate sets with many disjuncts.
Only perform the optimization with respect to individual earlier disjuncts
rather than with respect to (the union of) all earlier disjuncts
to reduce the risk of constructing intermediate sets with a large
number of disjuncts.

An example of an input set that would result in such a large intermediate
set is the following:

    [p_0, p_1, p_2, p_3, p_4, p_5, p_6, p_7, p_8, p_9, p_10, p_11, p_12,
    p_13, p_14, p_15, p_16, p_17, p_18, p_19, p_20, p_21, p_22, p_23,
    p_24, p_25, p_26] -> {  : p_15 <= -1 or p_15 >= 1 or (p_12 <= -1 and
    p_13 <= -1) or (p_12 <= -1 and p_13 >= 1) or (p_25 <= -1 and p_26 <=
    -1) or (p_25 <= -1 and p_26 >= 1) or (p_25 >= 1 and p_26 <= -1) or
    (p_25 >= 1 and p_26 >= 1) or (p_12 >= 1 and p_13 <= -1) or (p_12 >=
    1 and p_13 >= 1) or (p_4 <= -1 and p_5 <= -1 and p_7 >= 1 + p_6) or
    (p_4 <= -1 and p_5 >= 1 and p_7 >= 1 + p_6) or (p_4 >= 1 and p_5 <=
    -1 and p_7 >= 1 + p_6) or (p_4 >= 1 and p_5 >= 1 and p_7 >= 1 + p_6)
    or (p_2 = 3 and p_3 <= 143) or (p_0 = 2 and p_1 <= 121) or (p_22 =
    1 and p_23 <= -1) or (p_22 = 1 and p_23 >= 1) or (p_11 = 0 and p_10
    <= -1) or (p_11 = 0 and p_10 >= 1) or (p_9 = 0 and p_8 <= -1) or
    (p_9 = 0 and p_8 >= 1) or (p_25 = 0 and p_24 <= -1 and p_26 <= -1)
    or (p_25 = 0 and p_24 <= -1 and p_26 >= 1)}

Reported-by: Tobias Grosser <tobias@grosser.es>
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_ast_build_expr.c