mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-22 19:49:49 +00:00
Round up stack to multiple of alignment only if it's a leaf function without alloca.
llvm-svn: 33401
This commit is contained in:
parent
174826c1b9
commit
6271410520
@ -917,14 +917,17 @@ void ARMRegisterInfo::emitPrologue(MachineFunction &MF) const {
|
||||
|
||||
// If necessary, add one more SUBri to account for the call frame
|
||||
// and/or local storage, alloca area.
|
||||
if (MFI->hasCalls() && !hasFP(MF))
|
||||
if (MFI->hasCalls() || MF.getFrameInfo()->hasVarSizedObjects()) {
|
||||
// We reserve argument space for call sites in the function immediately on
|
||||
// entry to the current function. This eliminates the need for add/sub
|
||||
// brackets around call sites.
|
||||
NumBytes += MFI->getMaxCallFrameSize();
|
||||
if (!hasFP(MF))
|
||||
NumBytes += MFI->getMaxCallFrameSize();
|
||||
|
||||
// Round the size to a multiple of the alignment.
|
||||
NumBytes = (NumBytes+Align-1)/Align*Align;
|
||||
}
|
||||
|
||||
// Round the size to a multiple of the alignment.
|
||||
NumBytes = (NumBytes+Align-1)/Align*Align;
|
||||
MFI->setStackSize(NumBytes);
|
||||
|
||||
// Determine starting offsets of spill areas.
|
||||
|
Loading…
Reference in New Issue
Block a user