diff options
author | Jim Laskey <jlaskey@mac.com> | 2006-11-11 10:21:58 +0000 |
---|---|---|
committer | Jim Laskey <jlaskey@mac.com> | 2006-11-11 10:21:58 +0000 |
commit | 4bfd1e9b43f589c7a2e2d45baa226496bb46d865 (patch) | |
tree | 7ecc3110adfe603498c26548bb6966bc87746f79 | |
parent | 5cd3e9f4b7caa5a79c6c05633b11144d0ae41771 (diff) | |
download | llvm-4bfd1e9b43f589c7a2e2d45baa226496bb46d865.tar.gz llvm-4bfd1e9b43f589c7a2e2d45baa226496bb46d865.tar.bz2 llvm-4bfd1e9b43f589c7a2e2d45baa226496bb46d865.tar.xz |
Running with frame pointers prevented debugging, external probes and
potentially some system calls/exception handling from working. TOS must always
link to previous frame. This is a short term workaround until alloca scheme is
reworked.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31677 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/PowerPC/PPCRegisterInfo.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Target/PowerPC/PPCRegisterInfo.cpp b/lib/Target/PowerPC/PPCRegisterInfo.cpp index 98ada71eb0..931dac1761 100644 --- a/lib/Target/PowerPC/PPCRegisterInfo.cpp +++ b/lib/Target/PowerPC/PPCRegisterInfo.cpp @@ -382,7 +382,8 @@ eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB, MachineBasicBlock::iterator I) const { if (hasFP(MF)) { // If we have a frame pointer, convert as follows: - // ADJCALLSTACKDOWN -> addi, r1, r1, -amount + // ADJCALLSTACKDOWN -> lwz r0, 0(r31) + // stwu, r0, -amount(r1) // ADJCALLSTACKUP -> addi, r1, r1, amount MachineInstr *Old = I; unsigned Amount = Old->getOperand(0).getImmedValue(); @@ -395,7 +396,9 @@ eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB, // Replace the pseudo instruction with a new instruction... if (Old->getOpcode() == PPC::ADJCALLSTACKDOWN) { - BuildMI(MBB, I, PPC::ADDI, 2, PPC::R1).addReg(PPC::R1).addImm(-Amount); + BuildMI(MBB, I, PPC::LWZ, 2, PPC::R0).addImm(0).addReg(PPC::R31); + BuildMI(MBB, I, PPC::STWU, 3) + .addReg(PPC::R0).addImm(-Amount).addReg(PPC::R1); } else { assert(Old->getOpcode() == PPC::ADJCALLSTACKUP); BuildMI(MBB, I, PPC::ADDI, 2, PPC::R1).addReg(PPC::R1).addImm(Amount); |