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

Nate Begeman natebegeman at mac.com
Sun Aug 22 01:09:28 PDT 2004



Changes in directory llvm/lib/Target/PowerPC:

PPC32RegisterInfo.cpp updated: 1.2 -> 1.3
---
Log message:

Don't hard code the offset of the saved R31 in functions with frame pointers

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

Index: llvm/lib/Target/PowerPC/PPC32RegisterInfo.cpp
diff -u llvm/lib/Target/PowerPC/PPC32RegisterInfo.cpp:1.2 llvm/lib/Target/PowerPC/PPC32RegisterInfo.cpp:1.3
--- llvm/lib/Target/PowerPC/PPC32RegisterInfo.cpp:1.2	Sat Aug 21 14:51:17 2004
+++ llvm/lib/Target/PowerPC/PPC32RegisterInfo.cpp	Sun Aug 22 03:09:17 2004
@@ -278,12 +278,13 @@
   
   // Get the number of bytes allocated from the FrameInfo...
   unsigned NumBytes = MFI->getStackSize();
+  unsigned GPRSize = getSpillSize(PPC::R31);
 
   if (NumBytes != 0) {
     if (hasFP(MF)) {
       MI = BuildMI(PPC::OR, 2, PPC::R1).addReg(PPC::R31).addReg(PPC::R31);
       MBB.insert(MBBI, MI);
-      MI = BuildMI(PPC::LWZ, 2, PPC::R31).addSImm(4).addReg(PPC::R31);
+      MI = BuildMI(PPC::LWZ, 2, PPC::R31).addSImm(GPRSize).addReg(PPC::R31);
       MBB.insert(MBBI, MI);
     }
     MI = BuildMI(PPC::LWZ, 2, PPC::R1).addSImm(0).addReg(PPC::R1);






More information about the llvm-commits mailing list