isl_schedule_constraints_compute_schedule: fix handling of coalescing schedules
commit5de7e46df1245df6227df30f38c2cbb2ba915d20
authorSven Verdoolaege <skimo@kotnet.org>
Sun, 1 May 2016 09:05:40 +0000 (1 11:05 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Tue, 3 May 2016 07:57:29 +0000 (3 09:57 +0200)
tree691b1c4f1992e093b545ab75a8ec6e2684e4386f
parentd03971af3334d0e8bc25bd437de1419909aa5efc
isl_schedule_constraints_compute_schedule: fix handling of coalescing schedules

In particular, if the user requests a non-coalescing schedule, but
the constraints only allow for a coalescing one, then in the case of
the Feautrier scheduler, the code would first try to make the schedule
non-coalescing, and then revert to the previous solution if this results
in a non-carrying schedule.  However, the logic was not implemented
correctly in f8f45df (isl_schedule_constraints_compute_schedule:
optionally avoid loop coalescing, Tue Apr 12 17:20:31 2016 +0200) and
the previous solution would end up getting freed before it was returned
to the user.
Remove the spurious free by reducing the window in which the previous
solution is kept.

The new test case was derived from a Polly test case that tickled
this bug and that was analyzed and reported by Michael Kruse.

Reported-by: Michael Kruse <isl@meinersbur.de>
Tested-by: Michael Kruse <isl@meinersbur.de>
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_scheduler.c
isl_test.c