[llvm-commits] [llvm] r96020 - /llvm/trunk/lib/Target/PowerPC/PPCRegisterInfo.cpp

Chris Lattner clattner at apple.com
Fri Feb 12 14:07:15 PST 2010


On Feb 12, 2010, at 2:00 PM, Dale Johannesen wrote:

> Author: johannes
> Date: Fri Feb 12 16:00:40 2010
> New Revision: 96020
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=96020&view=rev
> Log:
> This should have gone in with 26015, see comments there.

Does this prevent R2 from being allocated completely?

-Chris

> 
> 
> Modified:
>    llvm/trunk/lib/Target/PowerPC/PPCRegisterInfo.cpp
> 
> Modified: llvm/trunk/lib/Target/PowerPC/PPCRegisterInfo.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCRegisterInfo.cpp?rev=96020&r1=96019&r2=96020&view=diff
> 
> ==============================================================================
> --- llvm/trunk/lib/Target/PowerPC/PPCRegisterInfo.cpp (original)
> +++ llvm/trunk/lib/Target/PowerPC/PPCRegisterInfo.cpp Fri Feb 12 16:00:40 2010
> @@ -427,6 +427,12 @@
>     Reserved.set(PPC::R2);  // System-reserved register
>     Reserved.set(PPC::R13); // Small Data Area pointer register
>   }
> +  // Reserve R2 on Darwin to hack around the problem of save/restore of CR
> +  // when the stack frame is too big to address directly; we need two regs.
> +  // This is a hack.
> +  if (Subtarget.isDarwinABI()) {
> +    Reserved.set(PPC::R2);
> +  }
> 
>   // On PPC64, r13 is the thread pointer. Never allocate this register.
>   // Note that this is over conservative, as it also prevents allocation of R31
> @@ -447,6 +453,12 @@
>     if (Subtarget.isSVR4ABI()) {
>       Reserved.set(PPC::X2);
>     }
> +    // Reserve R2 on Darwin to hack around the problem of save/restore of CR
> +    // when the stack frame is too big to address directly; we need two regs.
> +    // This is a hack.
> +    if (Subtarget.isDarwinABI()) {
> +      Reserved.set(PPC::X2);
> +    }
>   }
> 
>   if (needsFP(MF))
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits





More information about the llvm-commits mailing list