[llvm-commits] [llvm] r75998 - /llvm/trunk/lib/Target/SystemZ/SystemZRegisterInfo.cpp

Anton Korobeynikov asl at math.spbu.ru
Thu Jul 16 07:12:36 PDT 2009


Author: asl
Date: Thu Jul 16 09:12:36 2009
New Revision: 75998

URL: http://llvm.org/viewvc/llvm-project?rev=75998&view=rev
Log:
Properly generate stack frame

Modified:
    llvm/trunk/lib/Target/SystemZ/SystemZRegisterInfo.cpp

Modified: llvm/trunk/lib/Target/SystemZ/SystemZRegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/SystemZ/SystemZRegisterInfo.cpp?rev=75998&r1=75997&r2=75998&view=diff

==============================================================================
--- llvm/trunk/lib/Target/SystemZ/SystemZRegisterInfo.cpp (original)
+++ llvm/trunk/lib/Target/SystemZ/SystemZRegisterInfo.cpp Thu Jul 16 09:12:36 2009
@@ -193,8 +193,9 @@
   // Get the number of bytes to allocate from the FrameInfo.
   // Note that area for callee-saved stuff is already allocated, thus we need to
   // 'undo' the stack movement.
-  uint64_t StackSize =
-    MFI->getStackSize() - SystemZMFI->getCalleeSavedFrameSize();
+  uint64_t StackSize =  MFI->getStackSize();
+  uint64_t NumBytes = StackSize - SystemZMFI->getCalleeSavedFrameSize();
+  NumBytes -= TFI.getOffsetOfLocalArea();
 
   // Skip the callee-saved push instructions.
   while (MBBI != MBB.end() &&
@@ -205,9 +206,8 @@
   if (MBBI != MBB.end())
     DL = MBBI->getDebugLoc();
 
-  uint64_t NumBytes = StackSize - TFI.getOffsetOfLocalArea();
-
-  if (NumBytes) // adjust stack pointer: R15 -= numbytes
+  // adjust stack pointer: R15 -= numbytes
+  if (StackSize)
     emitSPUpdate(MBB, MBBI, -(int64_t)NumBytes, TII);
 
   if (hasFP(MF)) {





More information about the llvm-commits mailing list