isl_ast_build_expr_from_basic_set: exploit earlier constraints
commite6f201b87b208071a4e60648f34c1ce5f8089863
authorSven Verdoolaege <skimo@kotnet.org>
Sat, 9 Nov 2013 22:00:27 +0000 (9 23:00 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Tue, 5 Aug 2014 13:12:41 +0000 (5 15:12 +0200)
treef07b45c2f9c9be2d92ba31a78f1c47921f79be23
parentb27aa037aa55e1c7c49a2eb0fef085f76911b7a6
isl_ast_build_expr_from_basic_set: exploit earlier constraints

In particular, exploit the information in constraints that do not
involve integer divisions to try and simplify the integer divisions
in the constraints that do contain them.

For example, the guard

    if (n >= 0 && n >= 4 * floord(n, 4) + 2)

can be simplified to

    if (n >= 0 && n % 4 >= 2)

since the value of the "n >= 4 * floord(n, 4) + 2" is only relevant
if "n >= 0" is true, in which case the argument of the integer division
is known to be non-negative and the integer division can be converted
to a C-like modulo expression.

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_ast_build_expr.c
test_inputs/codegen/cloog/reservoir-liu-zhuge1.c
test_inputs/codegen/omega/iter9-0.c
test_inputs/codegen/pldi2012/figure8_b.c
test_inputs/codegen/unroll4.c