summaryrefslogtreecommitdiff
path: root/lib/Target/PowerPC/PPCRegisterInfo.td
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-11-20 20:48:05 +0000
committerChris Lattner <sabre@nondot.org>2006-11-20 20:48:05 +0000
commite9c9f98f719cc597444181cd6634fac247f8f68c (patch)
tree6cc509928c831b1952dca6e481db2f9d419fceb7 /lib/Target/PowerPC/PPCRegisterInfo.td
parent0374248e86f66231ff5f07e6bce14e3dd67abd14 (diff)
downloadllvm-e9c9f98f719cc597444181cd6634fac247f8f68c.tar.gz
llvm-e9c9f98f719cc597444181cd6634fac247f8f68c.tar.bz2
llvm-e9c9f98f719cc597444181cd6634fac247f8f68c.tar.xz
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
Diffstat (limited to 'lib/Target/PowerPC/PPCRegisterInfo.td')
-rw-r--r--lib/Target/PowerPC/PPCRegisterInfo.td6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Target/PowerPC/PPCRegisterInfo.td b/lib/Target/PowerPC/PPCRegisterInfo.td
index 6c18e17eeb..51000f9a08 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<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