isl_ast_build_ast_from_schedule: improve handling of unroll options
The core algorithm assumes that the result of compute_domains consists
of disjoint domains and may end up in an infinite recursion if they
overlap. As in the case of atomic domains, the unroll domais may
actually be larger than those specified by the user because some
constraints may be simplified away. In combination with separation
classes, this may result in the unroll domains in one class overlapping
with the unroll domains in another class.
We therefore now compute the unroll domains earlier and we intersect
them with the class domain again to ensure that the result does not
overlap with other classes. We also update the class domain to
reflect the atomic and unroll domains so that these would not overlap
with other domains within the same class domain.
Reported-by: Tobias Grosser <tobias@grosser.es>
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>