Patch to simplify reload register allocation

Bernd Schmidt bernds@cygnus.co.uk
Sun Oct 31 23:33:00 GMT 1999


>     The key concept is that using a hard register as a reload register
>     does not reserve the hard register as a reload register for the entire
>     function; only for the lifetime of the insn where it was needed.
> 
> That's a pretty major change that I hadn't noticed yet.
> 
>     This greatly reduces spilling & reloading because when we need a
>     particular hard register at a particular point in the insn chain, at
>     worst we should spill one pseudo (the one that was assigned to that
>     hard register at that particular point in the chain).
> 
> I assume this has all been considered, but what if the pseudo that ends
> up being spilled had a REG_EQUIV note to a constant?  Spilling it locally
> isn't going to be as efficient as spilling it globally would be.  I also
> think there are similar things on machines such as VAX, where a MEM is
> always a valid address.

The change works differently than you expect, it's not quite as radical.
If a pseudo is spilled, it's still spilled for its entire lifetime.  The
difference is that only those pseudos live across an insn which needs a
reload register are spilled, not _all_ pseudos allocated to that reload
register as before.

Bernd



More information about the Gcc-patches mailing list