[llvm-commits] [llvm] r78318 - in /llvm/trunk: include/llvm/CodeGen/RegisterScavenging.h lib/CodeGen/RegisterScavenging.cpp

Evan Cheng evan.cheng at apple.com
Thu Aug 6 23:35:34 PDT 2009


On Aug 6, 2009, at 2:59 PM, John Mosby wrote:

> On Thu, Aug 6, 2009 at 2:41 PM, Jakob Stoklund Olesen  
> <stoklund at 2pi.dk> wrote:
>
> The RS can get you a register in two ways:
>
> 1. FindUnusedReg() tries to find a register that is currently not
> being used, and so can be used _for free_.
> 2. scavengeRegister() will create a free register by saving it to the
> emergency spill slot.
>
> Indeed.

Thanks John for your work.

I think we should consider changing the scavenger. I think it's  
getting a bit too complicated. I don't think it should be the  
scavenger's responsibility to track what callee save registers have  
been used or not. The caller should be the one that determines what  
registers should not be scavenged. That is, this FindUnusedReg
unsigned RegScavenger::FindUnusedReg(const TargetRegisterClass  
*RegClass,
                                      bool ExCalleeSaved)

probably ought to be eliminated.

>
> FindUnusedReg() must not return a CSR that has not been spilled yet -
> it won't be spilled at all if that happens. It will simply be  
> clobbered.
>
> We're changing PEI to allow it to allocate registers using RS in  
> certain situations. It will use CSRs that are not already used in  
> the function and spill them as necessary.
> I'm going to disable part of my last commit until I have finished  
> the changes to PEI.

Thanks,

Evan


>
> Thanks!
> John
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20090806/290c0d64/attachment.html>


More information about the llvm-commits mailing list