mirror of
https://github.com/RPCS3/llvm.git
synced 2025-03-09 05:11:39 +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@11450 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
93799292c1
commit
e9dd84ea8a
@ -190,16 +190,18 @@ void X86RegisterInfo::emitPrologue(MachineFunction &MF) const {
|
||||
MBB.insert(MBBI, MI);
|
||||
|
||||
} else {
|
||||
// When we have no frame pointer, we reserve argument space for call sites
|
||||
// in the function immediately on entry to the current function. This
|
||||
// eliminates the need for add/sub ESP brackets around call sites.
|
||||
//
|
||||
NumBytes += MFI->getMaxCallFrameSize();
|
||||
|
||||
// Round the size to a multiple of the alignment (don't forget the 4 byte
|
||||
// offset though).
|
||||
unsigned Align = MF.getTarget().getFrameInfo().getStackAlignment();
|
||||
NumBytes = ((NumBytes+4)+Align-1)/Align*Align - 4;
|
||||
if (MFI->hasCalls()) {
|
||||
// When we have no frame pointer, we reserve argument space for call sites
|
||||
// in the function immediately on entry to the current function. This
|
||||
// eliminates the need for add/sub ESP brackets around call sites.
|
||||
//
|
||||
NumBytes += MFI->getMaxCallFrameSize();
|
||||
|
||||
// Round the size to a multiple of the alignment (don't forget the 4 byte
|
||||
// offset though).
|
||||
unsigned Align = MF.getTarget().getFrameInfo().getStackAlignment();
|
||||
NumBytes = ((NumBytes+4)+Align-1)/Align*Align - 4;
|
||||
}
|
||||
|
||||
// Update frame info to pretend that this is part of the stack...
|
||||
MFI->setStackSize(NumBytes);
|
||||
|
Loading…
x
Reference in New Issue
Block a user