- Tell PEI that PPC will handle stack frame rounding itself.
authorEvan Cheng <evan.cheng@apple.com>
Thu, 25 Jan 2007 22:25:04 +0000 (22:25 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Thu, 25 Jan 2007 22:25:04 +0000 (22:25 +0000)
- Do not round up to max. alignment of stack object if it is > stack alignment.
  It will have to be handled with dynamic aligning code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33505 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/PowerPC/PPCRegisterInfo.cpp
lib/Target/PowerPC/PPCRegisterInfo.h

index 465960afda41390148d0de34714bbba27886283d..76ade794141bab9307f284c5731c4cdcbe9e236d 100644 (file)
@@ -451,9 +451,6 @@ void PPCRegisterInfo::lowerDynamicAlloc(MachineBasicBlock::iterator II) const {
   // Determine the maximum call stack size.  maxCallFrameSize may be
   // less than the minimum.
   unsigned maxCallFrameSize = MFI->getMaxCallFrameSize();
-  unsigned getMinCallFrameSize =
-    PPCFrameInfo::getMinCallFrameSize(LP64); 
-  maxCallFrameSize = std::max(maxCallFrameSize, getMinCallFrameSize);
   // Get the total frame size.
   unsigned FrameSize = MFI->getStackSize();
   
@@ -712,11 +709,9 @@ void PPCRegisterInfo::determineFrameLayout(MachineFunction &MF) const {
   
   // Get the alignments provided by the target, and the maximum alignment
   // (if any) of the fixed frame objects.
-  unsigned TargetAlign = MF.getTarget().getFrameInfo()->getStackAlignment();
   unsigned MaxAlign = MFI->getMaxAlignment();
-  unsigned Align = std::max(TargetAlign, MaxAlign);
-  assert(isPowerOf2_32(Align) && "Alignment is not power of 2");
-  unsigned AlignMask = Align - 1;  //
+  unsigned TargetAlign = MF.getTarget().getFrameInfo()->getStackAlignment();
+  unsigned AlignMask = TargetAlign - 1;  //
 
   // If we are a leaf function, and use up to 224 bytes of stack space,
   // don't have a frame pointer, calls, or dynamic alloca then we do not need
index 7d35c6a26ae35da20c1ff5e8252c928598eb19e2..f8344de6ac156486090e8003c201d70eb8b24731 100644 (file)
@@ -58,6 +58,11 @@ public:
 
   const TargetRegisterClass* const* getCalleeSavedRegClasses() const;
 
+  /// targetHandlesStackFrameRounding - Returns true if the target is
+  /// responsible for rounding up the stack frame (probably at emitPrologue
+  /// time).
+  bool targetHandlesStackFrameRounding() const { return true; }
+
   bool hasFP(const MachineFunction &MF) const;
 
   void eliminateCallFramePseudoInstr(MachineFunction &MF,