update lower bounds during clast construction
Stride detection was extended in
814dcc1 (detect strides even if the
remainder of the lower bound depends on outer iterators, Sat Aug 14
15:51:04 2010 +0200) to include cases where the lower bounds depend
on outer iterators. These lower bounds need to be updated to ensure
that the initial value of the loop iterator satisfies the stride
constraint. This update is currently performed on the iteration domains.
This can sometimes be useful as the updated bounds can in some cases
result in simplification. However, by definition, these updated bounds
are redundant and so they may disappear during later simplifications.
We therefore need to update the lower bounds also during the construction
of the clasts. This update was already being performed for those cases
where the lower bound is a constant expression. Now it is also performed
in the other cases.
Without this patch the inner loop of the new test case would be generated
as
c1 = 1;
if (c1 <= 32) {
S1(c0+g1-1,c1+g2-1);
}
instead of
c1 = -32*floord(t1-1,32)+t1;
if (c1 <= 32) {
S1(c0+g1-1,c1+g2-1);
}
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>