PetScan::set_upper_bounds: handle arrays declared inside loops
Support for arrays declared inside loops was broken by
1bcd2f8
(pet_scop_from_pet_tree: extract pet_scop from the root down to the leaves,
Wed Jan 1 14:32:37 2014 +0100) because we started keeping track
of the outer loop iterators in the pet_context, which would then
appear in the affine expression extracted from the size expression
while an expression with a zero-dimensional domain is expected.
Remove those dimensions from the affine expression, assuming the
expression does not depend on them.
If the affine expression extracted from the size expression does
depend on the outer loop iterators then the original code (before
the breakage explained above) would produce a meaningless result
with an empty context. This commits ignores such size expressions,
effectively leaving the extent of the array unknown.
In future, we may want to either warn about this situation or
compute a static upper bound on the size expression.
Reported-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>