Skip to content

Commit 1ccd614

Browse files
author
JP Bonn
committedJul 13, 2012
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
1 parent 835537f commit 1ccd614

File tree

1 file changed

+0
-40
lines changed

1 file changed

+0
-40
lines changed
 

‎lib/Target/LM32/LM32FrameLowering.cpp

-40
Original file line numberDiff line numberDiff line change
@@ -41,43 +41,6 @@ LM32FrameLowering::LM32FrameLowering(const LM32Subtarget &subtarget)
4141
}
4242

4343

44-
/// determineFrameLayout - Align the frame and maximum call frame and
45-
/// updated the sizes. Copied from SPU.
46-
void LM32FrameLowering::
47-
determineFrameLayout(MachineFunction &MF) const {
48-
MachineFrameInfo *MFI = MF.getFrameInfo();
49-
50-
// Get the number of bytes to allocate from the FrameInfo
51-
unsigned FrameSize = MFI->getStackSize();
52-
53-
// Get the alignments provided by the target, and the maximum alignment
54-
// (if any) of the fixed frame objects.
55-
unsigned TargetAlign = getStackAlignment();
56-
unsigned Align = std::max(TargetAlign, MFI->getMaxAlignment());
57-
assert(isPowerOf2_32(Align) && "Alignment is not power of 2");
58-
unsigned AlignMask = Align - 1;
59-
60-
// Get the maximum call frame size of all the calls.
61-
unsigned maxCallFrameSize = MFI->getMaxCallFrameSize();
62-
63-
// If we have dynamic alloca then maxCallFrameSize needs to be aligned so
64-
// that allocations will be aligned.
65-
if (MFI->hasVarSizedObjects())
66-
maxCallFrameSize = (maxCallFrameSize + AlignMask) & ~AlignMask;
67-
68-
// Update maximum call frame size.
69-
MFI->setMaxCallFrameSize(maxCallFrameSize);
70-
71-
// Include call frame size in total.
72-
FrameSize += maxCallFrameSize;
73-
74-
// Make sure the frame is aligned.
75-
FrameSize = (FrameSize + AlignMask) & ~AlignMask;
76-
77-
// Update frame info.
78-
MFI->setStackSize(FrameSize);
79-
}
80-
8144
/// hasFP - Return true if the specified function should have a dedicated frame
8245
/// pointer register. This is true if the stacksize > 0 and either the
8346
/// function has variable sized allocas or frame pointer elimination
@@ -110,9 +73,6 @@ emitPrologue(MachineFunction &MF) const {
11073

11174
DebugLoc dl = (MBBI != MBB.end() ? MBBI->getDebugLoc() : DebugLoc());
11275

113-
// determineFrameLayout() sets some stack related sizes so do it first.
114-
determineFrameLayout(MF);
115-
11676
// Check the maximum call frame size of all the calls is sensible.
11777
assert(MFrmInf->getMaxCallFrameSize()%4 == 0 && "Misaligned call frame size");
11878

0 commit comments

Comments
 (0)
Please sign in to comment.