[LLVMdev] Moving data between regs

Chris Lattner sabre at nondot.org
Wed Jun 13 11:09:13 PDT 2007


On Tue, 12 Jun 2007, Fernando Magno Quintao Pereira wrote:
>     Imagine that I have a virtual v stored in register AL, and I am about
> to cross a function call, that effectively overwrites AL. Well, I have,
> say, register ESI free, but as it happens, ESI is bigger than AL. It
> should be technically possible to move the contents of AL into ESI, to
> avoid spilling 'v', but I don't know if that is possible in LLVM.
> Basically, ESI is not in the class of 'v', and it has no 8 bit alias. Is
> this a problem (the move can't be done), or am I missing something?

Very interesting idea.  Yes, this is doable.  On X86 you would copy EAX 
to ESI, which implicitly saves AL because it's a superclass of AL. 
MRegisterInfo has information about super and subclass registers, Evan can 
tell you more.

-Chris

-- 
http://nondot.org/sabre/
http://llvm.org/



More information about the llvm-dev mailing list