isl_schedule_get_map: handle trees with divergent filter node parameters
commit16231fd80c4bb3af1d83d8c386b4c411a7ecf746
authorSven Verdoolaege <sven.verdoolaege@gmail.com>
Sat, 24 Feb 2018 22:51:27 +0000 (24 23:51 +0100)
committerSven Verdoolaege <sven.verdoolaege@gmail.com>
Sun, 25 Feb 2018 21:42:06 +0000 (25 22:42 +0100)
tree26f7d0f847a7c7cd79759069f19e47c41b54bbd8
parent4d165419083057d6a76fb922c964534d726efb37
isl_schedule_get_map: handle trees with divergent filter node parameters

Most operations on schedule trees result in equal parameters
for the filter children of a set or sequence node.
However, the isl_schedule_node_gist performed by
isl_schedule_intersect_domain refrains from modifying
subtrees with a domain that is a subset of the context.
This may result in different parameters if some children
of a set/sequence node are modified and some are not.
isl_schedule_get_map picks the space of a single filter child node and
assumes it is valid for all children.
In particular, it calls isl_union_pw_multi_aff_multi_val_on_domain
on different children with the same second argument, while
this function assumes its arguments to have the same parameters.

Arguably, isl_union_pw_multi_aff_multi_val_on_domain should be changed
to align the parameters, but as a minimal fix, make sure it gets
called on arguments with the same parameters from isl_schedule_get_map.
An alternative would be to make sure that isl_schedule_intersect_domain
changes the filters in a uniform way, but it is not clear if this
is the only way divergence is introduced.
Of course, there is also no guarantee that there are no other places
that assume the parameters are the same.

Reported-by: Tobias Grosser <tobias@grosser.es>
Signed-off-by: Sven Verdoolaege <sven.verdoolaege@gmail.com>
isl_schedule_tree.c
isl_test.c