cloog_loop_generate_general: add special treatment for loops with constant value
commit9802965061171115824e7127771c2d12ea37c75a
authorSven Verdoolaege <skimo@kotnet.org>
Sat, 4 Dec 2010 16:57:26 +0000 (4 17:57 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Sun, 5 Dec 2010 09:52:06 +0000 (5 10:52 +0100)
treeee708621556571f0acf8d2c9c72f2d9e4a3c519b
parent2ebfe33859d31619db80cc76f1e31f1a3020be0a
cloog_loop_generate_general: add special treatment for loops with constant value

When the -noscalars option is used, the generated code could be different from
code generated without this option.  The reason is that during separation
at a constant level, the domains of the different loops could differ in values
of earlier dimensions or of parameters.  The result is that separation would
then be applied to these earlier dimensions and parameters.

This patch avoids separation if all loops under consideration can be
seen to have a fixed value at the current level.  The check does not
depend on not using the -noscalars option.  Since the check is applied
locally, it can also avoid some separations that are not avoided by
not using the -noscalars option.

In principle, the same optimization could be applied whenever all
constraints involving the current level are the same for the domains
of all loops, and the only differences are in constraints not involving
the current level.

Reported-by: Tobias Grosser <grosser@fim.uni-passau.de>
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
source/loop.c
test/Makefile.am
test/cholesky2.c
test/constant.c [new file with mode: 0644]
test/constant.cloog [new file with mode: 0644]
test/constant.good.c [new file with mode: 0644]
test/reservoir/lim-lam3.c