isl_ast_codegen.c: add_node: replace gist by pure specialization
commit4d247d734746f6377c99897f557f71b7515b9b69
authorSven Verdoolaege <skimo@kotnet.org>
Sat, 12 Oct 2013 18:23:22 +0000 (12 20:23 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Sat, 16 Aug 2014 13:45:05 +0000 (16 15:45 +0200)
treeb6131b5f6ce8cf0e1de4e8bb4d94f3cb98b9e310
parent35074178eda73658cda1674b8565028f62e560c3
isl_ast_codegen.c: add_node: replace gist by pure specialization

The main purpose of the "domain" set computed in add_node
is to detect strides.  The same set is later also used
to intersect "bounds" with additional equalities and
in the calls to exact_bound from refine_generic in
case there are no lower or upper bounds in "bounds".
The set is also used inside add_node to check if "bounds"
conflict with the build domain.

The call to isl_ast_build_compute_gist has several effects
- it plugs in the known values of outer loop iterators
- it detects conflicts with the build domain
- it may detect additional equalities
- it computes explicit representations for the divs
- it removes some constraints implied by the build domain

The final effect is undesired as it may result in the loss
of stride information as in the new test case.
In particular, the generated code would look like

    for (int c0 = 0; c0 < n - 1; c0 += 32)
      for (int c1 = c0 - 30; c1 < n; c1 += 1)
if (c1 % 32 == 0)

instead of

    for (int c0 = 0; c0 < n - 1; c0 += 32)
      for (int c1 = c0; c1 < n; c1 += 32)

because in part of the schedule domain c0 and c1 are equal and
we already know that c0 is a multiple of 32.  In that part of
the schedule domain, the gist therefore drops the information
that c1 is also a multiple of 32.

We therefore remove the gist computation and restrict
ourselves to plugging in the known values of outer loop iterators.

It is not clear if the computation of explicit representations
was intended, but it does seem to have a significant effect
on some of the test cases.  We therefore keep this computation,
but we have to do it explicitly now.
We may want to reconsider whether this computation should
be performed at a later stage.

The check for conflicts with the build domain is also made
explicit in this commit.

The only effect we do not keep here is the possible detection
of additional equalities.  It is not clear if this ever has
any effect in practical cases, but we can still add it back later
if it turns out to be useful later.

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_ast_build.c
isl_ast_build_private.h
isl_ast_codegen.c
test_inputs/codegen/cloog/nul_lcpc.c
test_inputs/codegen/cloog/param-split.c
test_inputs/codegen/lu.c [new file with mode: 0644]
test_inputs/codegen/lu.in [new file with mode: 0644]
test_inputs/codegen/omega/lefur03-0.c
test_inputs/codegen/omega/lefur04-0.c
test_inputs/codegen/separate2.c
test_inputs/codegen/separation_class2.c