Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
authored July 13, 2012

Showing 1 changed file with 0 additions and 40 deletions. Show diff stats Hide diff stats

  1. 40  lib/Target/LM32/LM32FrameLowering.cpp
40  lib/Target/LM32/LM32FrameLowering.cpp
@@ -41,43 +41,6 @@ LM32FrameLowering::LM32FrameLowering(const LM32Subtarget &subtarget)
41 41
 }
42 42
 
43 43
 
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  
-
81 44
 /// hasFP - Return true if the specified function should have a dedicated frame
82 45
 /// pointer register.  This is true if the stacksize > 0 and either the 
83 46
 /// function has variable sized allocas or frame pointer elimination 
@@ -110,9 +73,6 @@ emitPrologue(MachineFunction &MF) const {
110 73
 
111 74
   DebugLoc dl = (MBBI != MBB.end() ? MBBI->getDebugLoc() : DebugLoc());
112 75
 
113  
-  // determineFrameLayout() sets some stack related sizes so do it first.
114  
-  determineFrameLayout(MF);
115  
-
116 76
   // Check the maximum call frame size of all the calls is sensible.
117 77
   assert(MFrmInf->getMaxCallFrameSize()%4 == 0 && "Misaligned call frame size");
118 78
 

0 notes on commit 1ccd614

Please sign in to comment.
Something went wrong with that request. Please try again.