[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp PPCRegisterInfo.h

Evan Cheng evan.cheng at apple.com
Thu Jan 25 14:25:20 PST 2007



Changes in directory llvm/lib/Target/PowerPC:

PPCRegisterInfo.cpp updated: 1.97 -> 1.98
PPCRegisterInfo.h updated: 1.23 -> 1.24
---
Log message:

- Tell PEI that PPC will handle stack frame rounding itself.
- 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.

---
Diffs of the changes:  (+7 -7)

 PPCRegisterInfo.cpp |    9 ++-------
 PPCRegisterInfo.h   |    5 +++++
 2 files changed, 7 insertions(+), 7 deletions(-)


Index: llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp
diff -u llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.97 llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.98
--- llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.97	Wed Jan 24 12:45:13 2007
+++ llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp	Thu Jan 25 16:25:04 2007
@@ -451,9 +451,6 @@
   // 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 @@
   
   // 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: llvm/lib/Target/PowerPC/PPCRegisterInfo.h
diff -u llvm/lib/Target/PowerPC/PPCRegisterInfo.h:1.23 llvm/lib/Target/PowerPC/PPCRegisterInfo.h:1.24
--- llvm/lib/Target/PowerPC/PPCRegisterInfo.h:1.23	Wed Jan 24 12:45:13 2007
+++ llvm/lib/Target/PowerPC/PPCRegisterInfo.h	Thu Jan 25 16:25:04 2007
@@ -58,6 +58,11 @@
 
   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,






More information about the llvm-commits mailing list