diff options
author | Dale Johannesen <dalej@apple.com> | 2010-02-12 22:00:40 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2010-02-12 22:00:40 +0000 |
commit | ee25bc294204ef326994d4142dd6bea9605e6a63 (patch) | |
tree | 6b96b4c7ce1582982bfab08e05be951d9ad1f9e6 | |
parent | 83498e55e20077e2a6b05b335a62101b03ac44e0 (diff) | |
download | external_llvm-ee25bc294204ef326994d4142dd6bea9605e6a63.tar.gz external_llvm-ee25bc294204ef326994d4142dd6bea9605e6a63.tar.bz2 external_llvm-ee25bc294204ef326994d4142dd6bea9605e6a63.zip |
This should have gone in with 26015, see comments there.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96020 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/PowerPC/PPCRegisterInfo.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/Target/PowerPC/PPCRegisterInfo.cpp b/lib/Target/PowerPC/PPCRegisterInfo.cpp index 20e77e79c5..0b509ac161 100644 --- a/lib/Target/PowerPC/PPCRegisterInfo.cpp +++ b/lib/Target/PowerPC/PPCRegisterInfo.cpp @@ -427,6 +427,12 @@ BitVector PPCRegisterInfo::getReservedRegs(const MachineFunction &MF) const { Reserved.set(PPC::R2); // System-reserved register Reserved.set(PPC::R13); // Small Data Area pointer register } + // Reserve R2 on Darwin to hack around the problem of save/restore of CR + // when the stack frame is too big to address directly; we need two regs. + // This is a hack. + if (Subtarget.isDarwinABI()) { + Reserved.set(PPC::R2); + } // On PPC64, r13 is the thread pointer. Never allocate this register. // Note that this is over conservative, as it also prevents allocation of R31 @@ -447,6 +453,12 @@ BitVector PPCRegisterInfo::getReservedRegs(const MachineFunction &MF) const { if (Subtarget.isSVR4ABI()) { Reserved.set(PPC::X2); } + // Reserve R2 on Darwin to hack around the problem of save/restore of CR + // when the stack frame is too big to address directly; we need two regs. + // This is a hack. + if (Subtarget.isDarwinABI()) { + Reserved.set(PPC::X2); + } } if (needsFP(MF)) |