This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: A few little loop.c cleanup patches
- To: rth at cygnus dot com
- Subject: Re: A few little loop.c cleanup patches
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- Date: Sat, 26 Aug 00 06:56:18 EDT
- Cc: gcc-patches at gcc dot gnu dot org
Wouldn't you want to do unrolling before strength reduction? Given
something like
for (i = 0; i < 100; ++i)
x[i] += 2;
and a machine with sensible displacements, you'd want the x+0, x+4,
x+8, x+12 to use one reduced register. I'm not sure how this is
handled now (or if it is), but surely it would be easier to just
do unrolling earlier.
My view is that you want to do it *in the middle* of strength reduction.
You first identify the bivs and givs, then unroll the loop updating the biv
and giv data, then finish the strength reduction. I've felt for a long time
that that approach will both be the simplest and give the best code.