[llvm-commits] CVS: llvm/lib/Target/ARM/ARMRegisterInfo.cpp

Evan Cheng evan.cheng at apple.com
Sat Jan 20 02:22:48 PST 2007



Changes in directory llvm/lib/Target/ARM:

ARMRegisterInfo.cpp updated: 1.37 -> 1.38
---
Log message:

Round up stack to multiple of alignment only if it's a leaf function without alloca.

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

 ARMRegisterInfo.cpp |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)


Index: llvm/lib/Target/ARM/ARMRegisterInfo.cpp
diff -u llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.37 llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.38
--- llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.37	Fri Jan 19 21:24:07 2007
+++ llvm/lib/Target/ARM/ARMRegisterInfo.cpp	Sat Jan 20 04:22:33 2007
@@ -917,14 +917,17 @@
 
   // If necessary, add one more SUBri to account for the call frame
   // and/or local storage, alloca area.
-  if (MFI->hasCalls() && !hasFP(MF))
+  if (MFI->hasCalls() || MF.getFrameInfo()->hasVarSizedObjects()) {
     // We reserve argument space for call sites in the function immediately on
     // entry to the current function.  This eliminates the need for add/sub
     // brackets around call sites.
-    NumBytes += MFI->getMaxCallFrameSize();
+    if (!hasFP(MF))
+      NumBytes += MFI->getMaxCallFrameSize();
+
+    // Round the size to a multiple of the alignment.
+    NumBytes = (NumBytes+Align-1)/Align*Align;
+  }
 
-  // Round the size to a multiple of the alignment.
-  NumBytes = (NumBytes+Align-1)/Align*Align;
   MFI->setStackSize(NumBytes);
 
   // Determine starting offsets of spill areas.






More information about the llvm-commits mailing list