[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp

Jim Laskey jlaskey at apple.com
Sat Nov 11 02:22:13 PST 2006



Changes in directory llvm/lib/Target/PowerPC:

PPCRegisterInfo.cpp updated: 1.77 -> 1.78
---
Log message:

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.


---
Diffs of the changes:  (+5 -2)

 PPCRegisterInfo.cpp |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)


Index: llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp
diff -u llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.77 llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.78
--- llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.77	Thu Nov  2 14:25:49 2006
+++ llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp	Sat Nov 11 04:21:58 2006
@@ -382,7 +382,8 @@
                               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 @@
 
       // 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);






More information about the llvm-commits mailing list