AST generation: use consistent set of pending constraints
commit4446cc0da947cb19650a94df233e4ec063301707
authorSven Verdoolaege <skimo@kotnet.org>
Thu, 16 Jul 2015 18:01:20 +0000 (16 20:01 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Mon, 20 Jul 2015 08:40:56 +0000 (20 10:40 +0200)
treeb04ff67c5d6155b664cd15066e767385fc955e2d
parentddd996c4c9374ff866ae56f8ec2ce3e0cf1b5b6a
AST generation: use consistent set of pending constraints

The constraints that determine the part of the schedule space for
which a (possibly degenerate) loop is generated are first checked
to see if they assign a single value in isl_ast_build_set_loop_bounds.
This function is also used to keep track of the subset of constraints that do
not involve the loop iterator in the "pending" constraints such that
they can be added in the guard on the loop after it has been generated.
The other constraints are stored in the "generated" constraints.
During the actual construction of the for loop, i.e., its initial
value and its condition, the constraints not involving the loop iterator
are ignored because they are handled by the pending constraints.

However, the constraints from which the loop is constructed are
simplified before the construction (and after they have been split
into pending and generated).  This simplification process may not
only remove constraints, but may also simplify individual constraints,
potentially turning them from "generated" constraints (i.e., those
that involve the current loop iterator) to "pending" constraints
(i.e., those that do not).
The update of pending and generated constraints has been split off into
a isl_ast_build_set_pending_generated function in the previous commit.
Move the simplification of the constraints before this update
such that the same set of pending constraints is used.

The fix in 1314871 (AST generation: remove redundant constraints before
determining loop bounds, Fri Jul 3 19:05:08 2015 +0200), was essentially
dealing with the same problem, but it was only a partial fix.
The present fix makes that partial fix redundant, but it does not
harm to keep it in.

Although the effect of the bug fixed by this commit has been seen
in the wild, it is difficult to extract a test case that does not
involve extension nodes while extension nodes are not handled
by the output verification in pet.

Reported-by: Tobias Grosser <tobias@grosser.es>
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_ast_codegen.c
test_inputs/codegen/cloog/faber.c
test_inputs/codegen/separate2.c