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>