Handle error conditions returned by level_before in isl_flow
Handle error conditions returned by level_before in isl_flow

Check the return value of level_before and intermediate_sources and pass
on the error the functions potentially return. The function
isl_access_info_sort_sources (and referenced functions) is also adapted
to propagate error conditions.

When isl-0.14-306-g5e596b8c2f started to use the isl schedule tree to
detect the order of accesses, it introduced a level_before function that
may also return -1, but failed to introduce code for handling such error
conditions in the callers. This resulted in unspecified behavior and
crashes, in cases where level_before returned a failure, e.g. in case of
a compute out.

Even though this commit would technically allow users to also return -1 as
error value, it does not yet update the user level documentation. It is
a pure bugfix. Expanding the user level interface should be a separate
discussion and commit.

This commit comes without a test case. It is difficult to provide
stable test cases, if the error condition that triggers the problem
depends on very specific values of the isl compute out.

Signed-off-by: Tobias Grosser <059b8b880f8441509ec8a65b50b4c6ae74ebea76@grosser.es>
Signed-off-by: Sven Verdoolaege <235c10dd23b819f81cdc9756a251746bc184cab6@gmail.com>

inducer/isl-mirror,nicolasvasilache/isl,Meinersbur/isl,Meinersbur/isl,inducer/isl-mirror,PollyLabs/isl,PollyLabs/isl,nicolasvasilache/isl,Meinersbur/isl,PollyLabs/isl,PollyLabs/isl,PollyLabs/isl,Meinersbur/isl,nicolasvasilache/isl,inducer/isl-mirror,inducer/isl-mirror,nicolasvasilache/isl,nicolasvasilache/isl,inducer/isl-mirror