My opinions on tree-level and RTL-level optimization
Roger Sayle
roger@eyesopen.com
Mon Apr 18 16:48:00 GMT 2005
On Mon, 18 Apr 2005, Paolo Bonzini wrote:
> Roger proposed lowering 64-bit arithmetic to 32-bit in tree-ssa! How
> would you do it? Take
>
> long long a, b, c;
> c = a + b;
>
> Would it be
>
> c = ((int)a + (int)b)
> + ((int) (a >> 32) + (int) (b >> 32)
> + ((unsigned int) a < (unsigned int) b)) << 32;
>
> Or will you introduce new tree codes and uglifying tree-ssa?
> Seriously...
I think you may have misinterpreted or over-interpreted
what I meant by performing optimizations/lowering, earlier vs.
later. When I suggested the i386.c backend should lower DImode
operations earlier, my intention was to lower during RTL expansion
instead of where it currently happens after reload. Whilst doing
it in tree-ssa would technically also be "doing it earlier", this
isn't really what I had in mind.
The fact that DImode moves aren't lowered, and that the high and
low parts of a DImode register can't be independently live/dead
(for register allocation) is the reason for PR17236, and why GCC
generates poorer code than Intel on something as simple as "a * b".
Not that it would be impossible to do this with trees. It's not
uncommon for representations to be lowered, for example high-level
trees to low-level trees. RTL has always done this, where addressof
could be seen as a lowering pass, as can combine, reload, regstack
and the process of splitting, where the RTL representation afterwards
is a more accurate description of the generated code than the RTL
representation before.
Roger
--
More information about the Gcc
mailing list