Skip to content
Snippets Groups Projects
Commit 24a03717 authored by Misha Brukman's avatar Misha Brukman
Browse files

* Follow the PowerPC convention of leaving 24 bytes for linking on the stack.

* Also leave space for spilling integer registers (this should be calculated)

llvm-svn: 14554
parent d028593c
No related branches found
No related tags found
No related merge requests found
...@@ -195,7 +195,10 @@ void PowerPCRegisterInfo::emitPrologue(MachineFunction &MF) const { ...@@ -195,7 +195,10 @@ void PowerPCRegisterInfo::emitPrologue(MachineFunction &MF) const {
// in the function immediately on entry to the current function. This // in the function immediately on entry to the current function. This
// eliminates the need for add/sub brackets around call sites. // 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 // Round the size to a multiple of the alignment (don't forget the 4 byte
// offset though). // offset though).
...@@ -217,7 +220,7 @@ void PowerPCRegisterInfo::emitPrologue(MachineFunction &MF) const { ...@@ -217,7 +220,7 @@ void PowerPCRegisterInfo::emitPrologue(MachineFunction &MF) const {
// adjust stack pointer: r1 -= numbytes // adjust stack pointer: r1 -= numbytes
if (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); MBB.insert(MBBI, MI);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment