mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-01 00:33:09 +00:00
There is no reason to align the stack pointer if there are no callees of this function!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11449 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
bb07ef97cf
commit
93799292c1
@ -216,8 +216,11 @@ void PEI::calculateFrameObjectOffsets(MachineFunction &Fn) {
|
|||||||
FFI->setObjectOffset(i, -Offset); // Set the computed offset
|
FFI->setObjectOffset(i, -Offset); // Set the computed offset
|
||||||
}
|
}
|
||||||
|
|
||||||
// Align the final stack pointer offset...
|
// Align the final stack pointer offset, but only if there are calls in the
|
||||||
Offset = (Offset+StackAlignment-1)/StackAlignment*StackAlignment;
|
// function. This ensures that any calls to subroutines have their stack
|
||||||
|
// frames suitable aligned.
|
||||||
|
if (FFI->hasCalls())
|
||||||
|
Offset = (Offset+StackAlignment-1)/StackAlignment*StackAlignment;
|
||||||
|
|
||||||
// Set the final value of the stack pointer...
|
// Set the final value of the stack pointer...
|
||||||
FFI->setStackSize(Offset-TFI.getOffsetOfLocalArea());
|
FFI->setStackSize(Offset-TFI.getOffsetOfLocalArea());
|
||||||
|
Loading…
Reference in New Issue
Block a user