AST generator: take into account some parameter constraints early on
commit2d9bbd4aa45091f74f0609fee5c6a9e76061b1e7
authorSven Verdoolaege <skimo@kotnet.org>
Thu, 22 May 2014 15:28:20 +0000 (22 17:28 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Sat, 16 Aug 2014 14:07:26 +0000 (16 16:07 +0200)
tree69cf31e2f39e34dff4b1aa6b41f5ec5b51e2d8ab
parent3c91f0197f98718cfc60f370ff2bc1c998e2238f
AST generator: take into account some parameter constraints early on

In particular, intersect the executed relation with some
of the parameter constraints.  We want to avoid breaking
up the executed relation into several pieces, so we only
intersect with a single disjunct parameter domain.

Taking into account these parameter constraints from the
start allows us to avoid investigating some cases that
will turn out to be impossible.

For example, for the omega/ts1d-mp-i_ts-m_b-0.a test case,
isl used to generate a loop

    for (int c1 = -1; c1 < (T >= 1 ? T : 0); c1 += 1)

because it needs to combine a disjunct where the bound is T
and a disjunct where the bound is 0 (and T is unconstrained).
By including the constraint T >= 0 from the context, this bound
can be directly constructed as in

    for (int c1 = -1; c1 < T; c1 += 1)

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_ast_codegen.c
test_inputs/codegen/cloog/jacobi-shared.c
test_inputs/codegen/cloog/vivien2.c
test_inputs/codegen/empty.c
test_inputs/codegen/omega/ts1d-mp-i_ts-m_b-0.c
test_inputs/codegen/shift2.c
test_inputs/codegen/unroll3.c