Variable Expansion Optimization
Michael Matz
matz@suse.de
Mon Aug 16 07:56:00 GMT 2004
Hi,
On Sun, 15 Aug 2004, Steven Bosscher wrote:
> Hmm, I guess you're going to have carefully analyze what the
> effects of such a transformation are on register pressure.
Yes. But note that this transformation mainly helps an autovectorizer.
For instance the summation loop, when unrolled 4 times, can be implemented
by carrying the four partial sums in one vector register, thus not
requiring more registers than without. Of course the right heuristics
have to be applied to make this work. Without such the added register
pressure is not worth this in most cases.
> The code for foo2 is really bad.
Ideally it would be autovectorized to use 2 SSE2 registers.
> I guess you need to work with the unroller to figure out when you can
> profitably apply this transformation. Perhaps you even want to be able
> to partially reroll a loop?
Ciao,
Michael.
More information about the Gcc
mailing list