pet_scop_compute_outer_to_inner: improve handling of size-1 arrays
pet_scop_compute_outer_to_inner constructs a mapping from outermost
arrays to innermost arrays, including constraints on the inner arrays.
There is, however, no need to include the constraints on the outermost
arrays. Since these constraints are distracting, they are removed
from the result through gisting. Unfortunately, this gist computation
does not have the desired effect when the outermost array has size 1.
For example, for an array "a" without record elements, the mapping
is first constructed as { a[0] -> a[0] } and gisting out the constraints
on the domain produces { a[i] -> a[0] } rather than the desired
{ a[i] -> a[i] }. That is, the fact that an outer element is mapped
to itself is lost (even if it is still implied since there is
only one element).
Use a different mechanism for computing the expansion that adds
constraints to an initial pure identity mapping rather than
starting from an identity mapping on the extent and then removing
constraints. In the above example, the final result is now
{ a[0] -> a[0] }. This is not exactly the expected result either,
but at least it is a subset of the expected result.
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>