Register renaming pass in gcc
Jan Hubicka
hubicka@atrey.karlin.mff.cuni.cz
Fri Apr 21 05:36:00 GMT 2000
> Actually if one judged regrename based on its current behavior on x86
> it would be considered ineffective so I'm not surprised you came to
I think actually Richard's email explains my confusion :)
> that conclusion. There are two reasons for this:
> - not many registers and I cannot use registers that are not saved
> in the prologue
Of course, but currently you rename only once around the available registers.
Why not do that round-robin as the comment suffest? Is there some actual problem?
Even having two registers to swap around in the unrolled loop body would improve
scheduling a lot.
Last question I have is loop I've expreimented with - just unrolled memcpy:
(set (reg 0) (mem))
(set (mem) (reg 0)) (reg dies here)
about 8 times. Your code don't seems to do any renaming at all, even when renaming
it to something like:
(set (reg 0) (mem))
(set (mem) (reg 0)) (reg dies here)
(set (reg 1) (mem))
(set (mem) (reg 1)) (reg dies here)
(set (reg 2) (mem))
(set (mem) (reg 2)) (reg dies here)
etc. would help a lot to schedule stores appart the loads. Your code seems to attempt
to rename only in the arithmetic operations so something like:
(set (reg 0) (plus (reg 0) (const)))
it changes to:
(set (reg 1) (plus (reg 0) (const)))
This amost never passes on i386, since it is 2 address, but still I se perfectly no
purpose for not renaming the first set as well.
Isn't that just another bug ? :))
> - on the x86 it only renames over basic blocks instead of extended basic
> blocks. Improvements to the algorithm will help this.
OK. Perhaps I can look at this issue.
Honza
More information about the Gcc
mailing list