[llvm-commits] [llvm] r75946 - /llvm/trunk/lib/Target/SystemZ/SystemZISelLowering.cpp

Anton Korobeynikov asl at math.spbu.ru
Thu Jul 16 06:52:11 PDT 2009


Author: asl
Date: Thu Jul 16 08:52:10 2009
New Revision: 75946

URL: http://llvm.org/viewvc/llvm-project?rev=75946&view=rev
Log:
Emit correct offset for PseudoSourceValue

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

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

==============================================================================
--- llvm/trunk/lib/Target/SystemZ/SystemZISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/SystemZ/SystemZISelLowering.cpp Thu Jul 16 08:52:10 2009
@@ -194,6 +194,9 @@
   DebugLoc dl = Op.getDebugLoc();
   MachineFunction &MF = DAG.getMachineFunction();
 
+  // Offset to first argument stack slot.
+  const unsigned FirstArgOffset = 160;
+
   // Analyze operands of the call, assigning locations to each operand.
   SmallVector<CCValAssign, 16> ArgLocs;
   CCState CCInfo(CC, isVarArg, getTargetMachine(), ArgLocs);
@@ -246,14 +249,13 @@
                               SystemZ::R11D : SystemZ::R15D),
                              getPointerTy());
 
-      SDValue PtrOff =
-        DAG.getNode(ISD::ADD, dl, getPointerTy(),
-                    StackPtr,
-                    DAG.getIntPtrConstant(160+VA.getLocMemOffset()));
+      unsigned Offset = FirstArgOffset + VA.getLocMemOffset();
+      SDValue PtrOff = DAG.getNode(ISD::ADD, dl, getPointerTy(),
+                                   StackPtr,
+                                   DAG.getIntPtrConstant(Offset));
 
       MemOpChains.push_back(DAG.getStore(Chain, dl, Arg, PtrOff,
-                                         PseudoSourceValue::getStack(),
-                                         VA.getLocMemOffset()));
+                                         PseudoSourceValue::getStack(), Offset));
     }
   }
 





More information about the llvm-commits mailing list