Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Since LM32FrameLowering::hasReservedCallFrame() always

returns true, alignment and updating the stacksize in regard
to the maximum call frame is handled by
PEI::calculateFrameObjectOffsets(), so it should not
be necessary to do this manually.

In fact, it is harmful, since the max call frame will be
added twice to stacksize.
Patch from Stefan Kristiansson
  • Loading branch information...
commit 1ccd6140d330c646d1e6d166effbde79e44c8cb5 1 parent 835537f
JP Bonn authored
Showing with 0 additions and 40 deletions.
  1. +0 −40 lib/Target/LM32/LM32FrameLowering.cpp
View
40 lib/Target/LM32/LM32FrameLowering.cpp
@@ -41,43 +41,6 @@ LM32FrameLowering::LM32FrameLowering(const LM32Subtarget &subtarget)
}
-/// determineFrameLayout - Align the frame and maximum call frame and
-/// updated the sizes. Copied from SPU.
-void LM32FrameLowering::
-determineFrameLayout(MachineFunction &MF) const {
- MachineFrameInfo *MFI = MF.getFrameInfo();
-
- // Get the number of bytes to allocate from the FrameInfo
- unsigned FrameSize = MFI->getStackSize();
-
- // Get the alignments provided by the target, and the maximum alignment
- // (if any) of the fixed frame objects.
- unsigned TargetAlign = getStackAlignment();
- unsigned Align = std::max(TargetAlign, MFI->getMaxAlignment());
- assert(isPowerOf2_32(Align) && "Alignment is not power of 2");
- unsigned AlignMask = Align - 1;
-
- // Get the maximum call frame size of all the calls.
- unsigned maxCallFrameSize = MFI->getMaxCallFrameSize();
-
- // If we have dynamic alloca then maxCallFrameSize needs to be aligned so
- // that allocations will be aligned.
- if (MFI->hasVarSizedObjects())
- maxCallFrameSize = (maxCallFrameSize + AlignMask) & ~AlignMask;
-
- // Update maximum call frame size.
- MFI->setMaxCallFrameSize(maxCallFrameSize);
-
- // Include call frame size in total.
- FrameSize += maxCallFrameSize;
-
- // Make sure the frame is aligned.
- FrameSize = (FrameSize + AlignMask) & ~AlignMask;
-
- // Update frame info.
- MFI->setStackSize(FrameSize);
-}
-
/// hasFP - Return true if the specified function should have a dedicated frame
/// pointer register. This is true if the stacksize > 0 and either the
/// function has variable sized allocas or frame pointer elimination
@@ -110,9 +73,6 @@ emitPrologue(MachineFunction &MF) const {
DebugLoc dl = (MBBI != MBB.end() ? MBBI->getDebugLoc() : DebugLoc());
- // determineFrameLayout() sets some stack related sizes so do it first.
- determineFrameLayout(MF);
-
// Check the maximum call frame size of all the calls is sensible.
assert(MFrmInf->getMaxCallFrameSize()%4 == 0 && "Misaligned call frame size");
Please sign in to comment.
Something went wrong with that request. Please try again.