aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMisha Brukman <brukman+llvm@gmail.com>2004-07-01 21:35:00 +0000
committerMisha Brukman <brukman+llvm@gmail.com>2004-07-01 21:35:00 +0000
commit452069abccca2a2ea2887220aceeedda8bb6b6d7 (patch)
tree16dd244b55ba1b68c21b091ad34de2e7eea0d043
parent425ff24bb3cd74a46cad98688547d33a12ea0ab6 (diff)
* Follow the PowerPC convention of leaving 24 bytes for linking on the stack.
* Also leave space for spilling integer registers (this should be calculated) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14554 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/PowerPC/PowerPCRegisterInfo.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Target/PowerPC/PowerPCRegisterInfo.cpp b/lib/Target/PowerPC/PowerPCRegisterInfo.cpp
index 5178970c11..ebf8ceb96c 100644
--- a/lib/Target/PowerPC/PowerPCRegisterInfo.cpp
+++ b/lib/Target/PowerPC/PowerPCRegisterInfo.cpp
@@ -195,7 +195,10 @@ void PowerPCRegisterInfo::emitPrologue(MachineFunction &MF) const {
// in the function immediately on entry to the current function. This
// eliminates the need for add/sub brackets around call sites.
//
- NumBytes += MFI->getMaxCallFrameSize();
+ NumBytes += MFI->getMaxCallFrameSize() +
+ 24 /* Predefined PowerPC link area */ +
+ 12*4 /* Spilled int regs */ +
+ 0*8 /* Spilled fp regs */;
// Round the size to a multiple of the alignment (don't forget the 4 byte
// offset though).
@@ -217,7 +220,7 @@ void PowerPCRegisterInfo::emitPrologue(MachineFunction &MF) const {
// adjust stack pointer: r1 -= numbytes
if (NumBytes) {
- MI = BuildMI(PPC32::STWU, 2, PPC32::R1).addImm(-80).addReg(PPC32::R1);
+ MI = BuildMI(PPC32::STWU, 2, PPC32::R1).addImm(-NumBytes).addReg(PPC32::R1);
MBB.insert(MBBI, MI);
}
}