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 <tobias@grosser.es>
Signed-off-by: Sven Verdoolaege <sven.verdoolaege@gmail.com>