[LLVMdev] Re: Spilling register and frame indices

Andrew Lenharth alenhar2 at cs.uiuc.edu
Wed May 24 06:56:29 PDT 2006

On Wed, 2006-05-24 at 10:07 +0400, Vladimir Prus wrote:
> Andrew Lenharth wrote: 
> > Alpha also has this problem for some offsets.  I haven't looked at what
> > PPC does, but alpha has the loads and stores that might need the
> > indexing kill an extra register, thus ensuring it is available for the
> > inserted instruction.  You don't need to reserve a register (globally)
> > only for these cases, just make sure you have it available when you need
> > it.
> I'm sorry I don't understand your suggestion. Unless I reserve a register
> globally, I might not have any register at all to use for addressing.
> - Volodya

If you look in AlphaInstrFormats.td the MForm class reserves R28 for
index calculations.  It does this by adding it to the Defs set for those
instructions.  Thus since the instruction is set as killing R28, it is
available for use if I insert an instruction immediately before the
ld/st.  Thus R28 can be used by the register allocator, but the RA makes
sure it is unused when there is an ld/st, thus giving me a scratch
register to use for index calculations with out completely reserving


More information about the llvm-dev mailing list