------- Additional Comments From rguenth at tat dot physik dot uni-tuebingen
dot de 2005-01-20 15:15 -------
Subject: Re: unrolling happens too late/SRA
does not happen late enough
On 20 Jan 2005, dberlin at dberlin dot org wrote:
> Wiat, why are we running SRA twice again at all?
> I can't figure this out from the bug report, other than seeing that we
> "could sra c.array", but i don't see why that requires a loop opt first.
We don't run sra twice. But an early loop unrolling will change f.i.
for (unsigned int d=0; d<4; ++d)
c.array[d] = a.array[d] * b.array[d];
to
c.array[0] = a.array[0] * b.array[0];
c.array[1] = a.array[1] * b.array[1];
c.array[2] = a.array[2] * b.array[2];
c.array[3] = a.array[3] * b.array[3];
and SRA can only scalarize this variant, not if the loop is still
there. That's the whole point of the loop<->sra ordering problem.
And of course sra may then expose new interesting choices for iv's
of outer loops - at least I think.
Richard.
--
Richard Guenther <richard dot guenther at uni-tuebingen dot de>
WWW: http://www.tat.physik.uni-tuebingen.de/~rguenth/
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18754