Unrolling/peeling of constant rolling loops
Richard Guenther
rguenth@tat.physik.uni-tuebingen.de
Mon Dec 6 13:37:00 GMT 2004
Hi!
I just figured out that for the testcase
void foo(int *bar)
{
int i=0;
for (; i<2; ++i)
bar[i] = 0;
}
we do not unroll the loop completely with -O2 (I was aware of that).
I thought we do so for -fpeel-loops - and in fact we do, but only
at the RTL level. To achieve the same at the tree level I need
to specify -funroll-loops, which in turn causes unrolling of
not constant rolling loops.
Can we somehow teach the tree-optimizers to unroll the loop in the
testcase without affecting not constant rolling loops and maybe
even at plain -O2 (and possibly -Os)? Or can we at least have
-fpeel-loops completely unroll loops at the tree level, too?
We already have means to control that complete peeling by
params max-completely-peeled-insns and max-completely-peel-times
which we could throttle down in case of not specifying
-funroll-loops and/or -fpeel-loops to make this transformation
a win with -O2 and -Os.
Thanks!
Richard.
--
Richard Guenther <richard dot guenther at uni-tuebingen dot de>
WWW: http://www.tat.physik.uni-tuebingen.de/~rguenth/
More information about the Gcc
mailing list