isl_union_access_info_compute_flow: handle coscheduled must-sources
commit9963b91e565ed8f2a7fa48bd9100457640f6b741
authorSven Verdoolaege <sven.verdoolaege@gmail.com>
Wed, 10 May 2017 16:34:52 +0000 (10 18:34 +0200)
committerSven Verdoolaege <sven.verdoolaege@gmail.com>
Mon, 12 Jun 2017 13:48:50 +0000 (12 15:48 +0200)
treec031fc87bad87168000a034d872255cdbf8c2bd4
parenta65b64863a9b95ddeefee64f2d7207882de070ee
isl_union_access_info_compute_flow: handle coscheduled must-sources

isl_union_access_info_compute_flow is defined to look for dependences
from the last must-source preceding a sink source as well as all
intermediate may-sources or simply any preceding may-source
if there is no preceding must-source.
This definition does not explain what happens when there are
multiple must-sources that are scheduled together or
when there are may-sources that are scheduled together
with a must-source.
What would happen in practice is that one of the must-sources
would result in a dependence, while all other coscheduled sources
would simply be ignored.

It can sometimes be useful to allow coscheduled sources,
especially in the high-level interface isl_union_access_info_compute_flow.
Given that the input does not specify whether the must-source
is executed before or after the other sources, the only sensible
result is for any dependence resulting from this must-source
to be considered a may-dependence, while the other sources
should also result in may-dependences.

This commit implements this result by looking for coscheduled
sources after an initial computation of the dependences
derived from a must-source at a given level.
The behavior with respect to sources that are not coscheduled
is not changed by this commit.
The change in behavior is also reflected in the documentation.

While this commit changes the behavior of isl_union_access_info_compute_flow,
it only does so in cases where it was undefined before.
Moreover, the original behavior was unreliable.

The low-level interface is not modified by this commit.
Users of the low-level interface should continue to ensure
that there are no coscheduled sources.

Signed-off-by: Sven Verdoolaege <sven.verdoolaege@gmail.com>
20 files changed:
doc/user.pod
isl_flow.c
test_inputs/flow/multi.ai [new file with mode: 0644]
test_inputs/flow/multi.flow [new file with mode: 0644]
test_inputs/flow/multi_source-tree.ai [new file with mode: 0644]
test_inputs/flow/multi_source-tree.flow [new file with mode: 0644]
test_inputs/flow/multi_source.ai [new file with mode: 0644]
test_inputs/flow/multi_source.flow [new file with mode: 0644]
test_inputs/flow/multi_source2-tree.ai [new file with mode: 0644]
test_inputs/flow/multi_source2-tree.flow [new file with mode: 0644]
test_inputs/flow/multi_source2.ai [new file with mode: 0644]
test_inputs/flow/multi_source2.flow [new file with mode: 0644]
test_inputs/flow/multi_source3-tree.ai [new file with mode: 0644]
test_inputs/flow/multi_source3-tree.flow [new file with mode: 0644]
test_inputs/flow/multi_source3.ai [new file with mode: 0644]
test_inputs/flow/multi_source3.flow [new file with mode: 0644]
test_inputs/flow/multi_source4-tree.ai [new file with mode: 0644]
test_inputs/flow/multi_source4-tree.flow [new file with mode: 0644]
test_inputs/flow/multi_source4.ai [new file with mode: 0644]
test_inputs/flow/multi_source4.flow [new file with mode: 0644]