[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCRegisterInfo.td

Chris Lattner sabre at nondot.org
Mon Nov 20 12:48:19 PST 2006



Changes in directory llvm/lib/Target/PowerPC:

PPCRegisterInfo.td updated: 1.41 -> 1.42
---
Log message:

in ppc64-mode, don't allocate the 32-bit version of r13 either.


---
Diffs of the changes:  (+6 -0)

 PPCRegisterInfo.td |    6 ++++++
 1 files changed, 6 insertions(+)


Index: llvm/lib/Target/PowerPC/PPCRegisterInfo.td
diff -u llvm/lib/Target/PowerPC/PPCRegisterInfo.td:1.41 llvm/lib/Target/PowerPC/PPCRegisterInfo.td:1.42
--- llvm/lib/Target/PowerPC/PPCRegisterInfo.td:1.41	Mon Nov 20 13:33:51 2006
+++ llvm/lib/Target/PowerPC/PPCRegisterInfo.td	Mon Nov 20 14:48:05 2006
@@ -224,6 +224,12 @@
     }
     GPRCClass::iterator
     GPRCClass::allocation_order_end(const MachineFunction &MF) const {
+      // On PPC64, r13 is the thread pointer.  Never allocate this register.
+      // Note that this is overconservative, as it also prevents allocation of
+      // R31 when the FP is not needed.
+      if (MF.getTarget().getSubtarget<PPCSubtarget>().isPPC64())
+        return end()-5;  // don't allocate R13, R31, R0, R1, LR
+        
       if (needsFP(MF))
         return end()-4;  // don't allocate R31, R0, R1, LR
       else






More information about the llvm-commits mailing list