isl_ast_build_ast_from_schedule: improve handling of overlapping 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. If the atomic domain conflicts and/or overlaps with other
option domains, then this invariant could be violated.
In particular, the atomic domain is typically overapproximated
because we want to represent it using a single basic set.
The result could then overlap with the option domains handled before
or with other separation classes.
We therefore now compute the atomic domain first and we intersect
it with the class domain again to ensure that the result does not
overlap with other classes. This intersection may result in the
single basic set being broken up into several basic sets.
Reported-by: Tobias Grosser <tobias@grosser.es>
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>