isl_union_set_compute_schedule: ensure carry_dependences makes progress
commit6b21b75cf239674ca6ab0943d9cce051c778d630
authorSven Verdoolaege <skimo@kotnet.org>
Sun, 4 Nov 2012 15:30:54 +0000 (4 16:30 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Sat, 10 Nov 2012 18:28:16 +0000 (10 19:28 +0100)
treedde64d153ec41492a4618799073b9c6954b6d9c6
parent5510326edbbcf2225cba7630af6cd329a58ff4a7
isl_union_set_compute_schedule: ensure carry_dependences makes progress

If solve_lp is unable to find a solution, then compute_schedule_wcc
calls carry_dependences to carry as many dependences as possible.

However, the reason that solve_lp was unable to find a solution
may be due to proximity dependences.  In particular, if there are
an infinite number of dependences with the same starting or ending
itereration, then the way proximity dependences are currently handled
may force some of the schedule coefficients to be zero based solely
on those proximity dependences.

carry_dependences may then fail to carry any (validity) dependences
simply because there are no validity dependences.
More generally, it may produce a non-trivial solution on only some
of the nodes.  This may result in a number of schedule rows (infinite
in the worst case) that is larger than the maximum computed in
compute_max_row, leading to out-of-bounds accesses.

We therefore check that the schedule row computed by carry_dependences
is non-trivial on all the nodes where it should be non-trivial.
If not, we try again on each dependence graph component separately
or fail if there is only one component.

Note that this commit does not fix the problem that the presence
of proximity dependences may eliminate some valid solutions,
but it should solve the out-of-bounds accesses.

Reported-by: Tobias Grosser <tobias@grosser.es>
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_schedule.c
isl_test.c