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

llvm-svn: 31884
This commit is contained in:
Chris Lattner 2006-11-20 20:48:05 +00:00
parent cd74ba8ae1
commit ed9a2f6371

View File

@ -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