diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Target/PowerPC/PPCRegisterInfo.td | 6 |
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 |