isl_ast_build_expr.c: extract_modulo: consider additional cases
commit6b88a37d4a5d7351ea927bb755c0af6b3c793f08
authorSven Verdoolaege <skimo@kotnet.org>
Thu, 14 Feb 2013 20:27:10 +0000 (14 21:27 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Wed, 18 Sep 2013 10:58:10 +0000 (18 12:58 +0200)
tree25546c68cac6de06e4b0402fa8d6c8114bb40c53
parent2566aef997c3be8f3a733c782bd461c43f7e5145
isl_ast_build_expr.c: extract_modulo: consider additional cases

In particular, look for any constraints in the domain that are equal
or opposite to the div expression (modulo the denominator).
Looking for such constraints is fairly cheap and the constraint
expression is guaranteed to be non-negative over the domain.

This allows us to detect some modulos that are fairly "obvious"
from the point of view of a user.  However, this will not catch
all "obvious" cases.  In particular, the new heuristic will not
catch those cases where the div expression can be written as
the sum of two or more constraints (modulo the denominator).

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
15 files changed:
isl_ast_build_expr.c
test_inputs/codegen/cloog/jacobi-shared.c
test_inputs/codegen/cloog/nul_complex1.c
test_inputs/codegen/cloog/reservoir-liu-zhuge1.c
test_inputs/codegen/hoist2.c
test_inputs/codegen/omega/dagstuhl1-1.c
test_inputs/codegen/omega/hpf-0.c
test_inputs/codegen/omega/iter9-0.c
test_inputs/codegen/omega/p.delft-0.c
test_inputs/codegen/omega/p.delft2-0.c
test_inputs/codegen/omega/stride6-0.c
test_inputs/codegen/shift2.c
test_inputs/codegen/single_valued.c
test_inputs/codegen/unroll4.c
test_inputs/codegen/unroll6.c