From: Chris Lattner Date: Mon, 20 Nov 2006 20:48:05 +0000 (+0000) Subject: in ppc64-mode, don't allocate the 32-bit version of r13 either. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=e9c9f98f719cc597444181cd6634fac247f8f68c;p=oota-llvm.git in ppc64-mode, don't allocate the 32-bit version of r13 either. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31884 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/PowerPC/PPCRegisterInfo.td b/lib/Target/PowerPC/PPCRegisterInfo.td index 6c18e17eebb..51000f9a080 100644 --- a/lib/Target/PowerPC/PPCRegisterInfo.td +++ b/lib/Target/PowerPC/PPCRegisterInfo.td @@ -224,6 +224,12 @@ def GPRC : RegisterClass<"PPC", [i32], 32, } 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().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