Handle error conditions returned by level_before in isl_flow
commit1a470034b195f400dd1711b145cdd7018de6d95d
authorTobias Grosser <tobias@grosser.es>
Mon, 24 Jul 2017 18:49:12 +0000 (24 20:49 +0200)
committerSven Verdoolaege <sven.verdoolaege@gmail.com>
Tue, 25 Jul 2017 13:01:24 +0000 (25 15:01 +0200)
tree41bdb3e353ce3634ffee5bd732daf9555c8a3684
parentd84b70af9a3a7f7a9a7fe5d2913f946c2e5314b6
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>
isl_flow.c