The short answer is this is not currently done. LLVM register allocator does not currently use a move to a different register class in lieu of spills. This is definitely something we should do in the future. Can you file a bugzilla enhancement request? Thanks, Evan On Jun 13, 2007, at 11:09 AM, Chris Lattner wrote:> 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/ > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Does this depend on vreg subreg support? It sounds as if it could be vaguely related, but I'm not sure it's necessary. -- Chris On Jun 14, 2007, at 12:27 PM, Evan Cheng wrote:> The short answer is this is not currently done. LLVM register > allocator does not currently use a move to a different register class > in lieu of spills. This is definitely something we should do in the > future. Can you file a bugzilla enhancement request? > > Thanks, > > Evan > > On Jun 13, 2007, at 11:09 AM, Chris Lattner wrote: > >> 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/ >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev-- Christopher Lamb -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20070614/fa13071d/attachment.html>
I consider this an orthogonal issue. While this particular example make use of sub-register info, that's not always the case. You can conceivably see a target where it's cheap(er) to move from an integer register to a floating point one, etc. Evan On Jun 14, 2007, at 12:40 PM, Christopher Lamb wrote:> Does this depend on vreg subreg support? It sounds as if it could > be vaguely related, but I'm not sure it's necessary. > > -- > Chris > > On Jun 14, 2007, at 12:27 PM, Evan Cheng wrote: > >> The short answer is this is not currently done. LLVM register >> allocator does not currently use a move to a different register class >> in lieu of spills. This is definitely something we should do in the >> future. Can you file a bugzilla enhancement request? >> >> Thanks, >> >> Evan >> >> On Jun 13, 2007, at 11:09 AM, Chris Lattner wrote: >> >>> 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/ >>> _______________________________________________ >>> LLVM Developers mailing list >>> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >> >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > -- > Christopher Lamb > > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20070614/62f3e094/attachment.html>