update lower bounds during clast construction
commit0bc530310a986fd39ebde3eb48bdf5107eecfc50
authorSven Verdoolaege <skimo@kotnet.org>
Thu, 2 Jun 2011 12:58:15 +0000 (2 14:58 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Thu, 2 Jun 2011 14:56:02 +0000 (2 16:56 +0200)
treeb69080164b9dc74a342592eafdfdd2eb56461616
parentc8928a4eb1fdf6b6bcd8f771863ed7138a9fde01
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>
include/cloog/stride.h
source/clast.c
source/isl/constraints.c
test/Makefile.am
test/isl/jacobi-shared.c [new file with mode: 0644]
test/isl/jacobi-shared.cloog [new file with mode: 0644]
test/isl/jacobi-shared.good.c [new file with mode: 0644]