<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<base href="x-msg://20306/">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
<div>Hi Robert,</div>
<div><br>
</div>
<div>Sorry for not getting around to reviewing this sooner, comments inline. Would you be able to supply an updated patch?</div>
<div><br>
</div>
<div>Thanks,</div>
<div><br>
</div>
<div>Richard </div>
<br>
<div>
<div>On 19 Jul 2013, at 15:07, Robert Lytton <<a href="mailto:robert@xmos.com">robert@xmos.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">
<div ocsi="0" fpstyle="1" style="font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">
<div style="direction: ltr; font-family: Tahoma; font-size: 10pt; ">Hi Richard,<br>
<br>
Here is a patch for handling byval arguments for the xcore ABI.<br>
<br>
robert<br>
<br>
</div>
<span><patch></span></div>
</blockquote>
</div>
<div><br>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px; ">
<br>
</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; "></div>
<blockquote type="cite">
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">diff --git a/lib/Target/XCore/XCoreISelLowering.cpp b/lib/Target/XCore/XCoreISelLowering.cpp</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">index 5f3d935..422fef3</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">--- a/lib/Target/XCore/XCoreISelLowering.cpp</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+++ b/lib/Target/XCore/XCoreISelLowering.cpp</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">@@ -1031,6 +1031,8 @@ XCoreTargetLowering::LowerCallResult(SDValue Chain, SDValue InFlag,</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; "> //             Formal Arguments Calling Convention Implementation</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; "> //===----------------------------------------------------------------------===//</div>
<p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px; "> <br class="webkit-block-placeholder">
</p>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+struct ByValPair{SDValue SDV; ISD::ArgFlagsTy Flags;};</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+</div>
</blockquote>
<div><br>
</div>
<div>Local types should be placed in an anonymous namespace.</div>
<blockquote type="cite">
<div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px; ">
<br>
</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; "> /// XCore formal arguments implementation</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; "> SDValue</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; "> XCoreTargetLowering::LowerFormalArguments(SDValue Chain,</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">@@ -1080,9 +1082,20 @@ XCoreTargetLowering::LowerCCCArguments(SDValue Chain,</div>
<p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px; "> <br class="webkit-block-placeholder">
</p>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">   unsigned LRSaveSize = StackSlotSize;</div>
<p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px; "> <br class="webkit-block-placeholder">
</p>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+  // all getMemcpys must follow getCopyFromReg to prevent clobbering</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+  // 1. CopyFromReg (and load) arg & vararg registers</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+  // 2. chain CopyFromReg nodes into a TokenFactor</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+  // 3. Memcpy any 'byVal' args</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+  // 4, chain all the mem ops nodes into a TokenFactor</div>
</blockquote>
<blockquote type="cite">
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+  SmallVector<SDValue, 4> RegNode;</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+  SmallVector<ByValPair, 4> BVData;</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+  SmallVector<SDValue, 4> MemOps;</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+  // 1a. CopyFromReg (and load) arg registers</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">   for (unsigned i = 0, e = ArgLocs.size(); i != e; ++i) {</div>
<p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px; "> <br class="webkit-block-placeholder">
</p>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">     CCValAssign &VA = ArgLocs[i];</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+    ISD::ArgFlagsTy Flags = Ins[i].Flags;</div>
<p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px; "> <br class="webkit-block-placeholder">
</p>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">     if (VA.isRegLoc()) {</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">       // Arguments passed in registers</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">@@ -1099,7 +1112,15 @@ XCoreTargetLowering::LowerCCCArguments(SDValue Chain,</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">       case MVT::i32:</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">         unsigned VReg = RegInfo.createVirtualRegister(&XCore::GRRegsRegClass);</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">         RegInfo.addLiveIn(VA.getLocReg(), VReg);</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">-        InVals.push_back(DAG.getCopyFromReg(Chain, dl, VReg, RegVT));</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+        SDValue CFRN = DAG.getCopyFromReg(Chain, dl, VReg, RegVT);</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+        RegNode.push_back(CFRN.getValue(CFRN->getNumValues()-1));</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+        if (Flags.isByVal() && Flags.getByValSize()) {</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+          // delay creating copy of byval argument & adding result to InVals</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+          const ByValPair BVD = {CFRN,Flags};</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+          BVData.push_back(BVD);</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+        } else {</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+          InVals.push_back(CFRN);</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+        }</div>
</blockquote>
<div><br>
</div>
This doesn't seem right. If I have a function such as void f(struct foo a, int b) then this will push the copyFromReg for b into InVals before it inserting the value for the byval structure into InVals, leaving InVals in the wrong order.</div>
<div>
<blockquote type="cite">
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">       }</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">     } else {</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">       // sanity check</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">@@ -1119,12 +1140,20 @@ XCoreTargetLowering::LowerCCCArguments(SDValue Chain,</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">       // Create the SelectionDAG nodes corresponding to a load</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">       //from this parameter</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">       SDValue FIN = DAG.getFrameIndex(FI, MVT::i32);</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">-      InVals.push_back(DAG.getLoad(VA.getLocVT(), dl, Chain, FIN,</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">-                                   MachinePointerInfo::getFixedStack(FI),</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">-                                   false, false, false, 0));</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+      SDValue GLN = DAG.getLoad(VA.getLocVT(), dl, Chain, FIN,</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+                                MachinePointerInfo::getFixedStack(FI),</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+                                false, false, false, 0);</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+      if (Flags.isByVal() && Flags.getByValSize()){</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+        // delay creating copy of byval argument & adding result to InVals</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+        const ByValPair BVD = {GLN,Flags};</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+        BVData.push_back(BVD);</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+      } else {</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+        InVals.push_back(GLN);</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+      }</div>
</blockquote>
You could avoid duplicating this code by moving it after the if / else.<br>
<blockquote type="cite">
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">     }</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">   }</div>
<p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px; "> <br class="webkit-block-placeholder">
</p>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+  // 1b. CopyFromReg vararg registers</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">   if (isVarArg) {</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">     /* Argument registers */</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">     static const uint16_t ArgRegs[] = {</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">@@ -1134,7 +1163,6 @@ XCoreTargetLowering::LowerCCCArguments(SDValue Chain,</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">     unsigned FirstVAReg = CCInfo.getFirstUnallocated(ArgRegs,</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">                                                      array_lengthof(ArgRegs));</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">     if (FirstVAReg < array_lengthof(ArgRegs)) {</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">-      SmallVector<SDValue, 4> MemOps;</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">       int offset = 0;</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">       // Save remaining registers, storing higher register numbers at a higher</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">       // address</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">@@ -1150,14 +1178,12 @@ XCoreTargetLowering::LowerCCCArguments(SDValue Chain,</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">         unsigned VReg = RegInfo.createVirtualRegister(&XCore::GRRegsRegClass);</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">         RegInfo.addLiveIn(ArgRegs[i], VReg);</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">         SDValue Val = DAG.getCopyFromReg(Chain, dl, VReg, MVT::i32);</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+        RegNode.push_back(Val.getValue(Val->getNumValues()-1));</div>
</blockquote>
LLVM Style is to have spaces around '-', <br>
<blockquote type="cite">
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">         // Move argument from virt reg -> stack</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">         SDValue Store = DAG.getStore(Val.getValue(1), dl, Val, FIN,</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">                                      MachinePointerInfo(), false, false, 0);</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">         MemOps.push_back(Store);</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">       }</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">-      if (!MemOps.empty())</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">-        Chain = DAG.getNode(ISD::TokenFactor, dl, MVT::Other,</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">-                            &MemOps[0], MemOps.size());</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">     } else {</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">       // This will point to the next argument passed via stack.</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">       XFI->setVarArgsFrameIndex(</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">@@ -1166,6 +1192,39 @@ XCoreTargetLowering::LowerCCCArguments(SDValue Chain,</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">     }</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">   }</div>
<p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px; "> <br class="webkit-block-placeholder">
</p>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+  // 2. chain CopyFromReg nodes into a TokenFactor</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+  if (!RegNode.empty())</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+    Chain = DAG.getNode(ISD::TokenFactor, dl, MVT::Other,</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+                        &RegNode[0], RegNode.size());</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+  // 3. Memcpy any 'byVal' args</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+  if (!BVData.empty()) {</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+    // aggregates passed "byVal" need to be copied by the callee</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+    // and a pointer to the copy used by the callee instead of</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+    // the original pointer (which is now in 'BVData.SDV')</div>
</blockquote>
Comments should be sentences with proper capitalisation and punctuation, see <a href="http://llvm.org/docs/CodingStandards.html#commenting">http://llvm.org/docs/CodingStandards.html#commenting</a></div>
<div><br>
</div>
<div><br>
<blockquote type="cite">
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+    for (SmallVectorImpl<ByValPair>::const_iterator</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+         BVDI = BVData.begin(), BVDE = BVData.end(); BVDI != BVDE; ++BVDI) {</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+      unsigned Size = BVDI->Flags.getByValSize();</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+      unsigned Align = BVDI->Flags.getByValAlign();</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+      // Create a new object on the stack and copy the pointee into it.</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+      int FI = MFI->CreateStackObject(Size, Align, false, false);</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+      SDValue FIN = DAG.getFrameIndex(FI, MVT::i32);</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+      InVals.push_back(FIN);</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+      MemOps.push_back(DAG.getMemcpy(Chain, dl, FIN, BVDI->SDV,</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+                                     DAG.getConstant(Size, MVT::i32),</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+                                     Align, false, false,</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+                                     MachinePointerInfo(),</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+                                     MachinePointerInfo()));</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+    }</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+  }</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+  // 4, chain all the mem ops nodes into a TokenFactor</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+  if (!MemOps.empty()){</div>
</blockquote>
Should be a space between ')' and '{'<br>
<blockquote type="cite">
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+    MemOps.push_back(Chain);</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+    Chain = DAG.getNode(ISD::TokenFactor, dl, MVT::Other,</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+                        &MemOps[0], MemOps.size());</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+  }</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">   return Chain;</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; "> }</div>
<p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px; "> <br class="webkit-block-placeholder">
</p>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">diff --git a/test/CodeGen/XCore/byVal.ll b/test/CodeGen/XCore/byVal.ll</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">index 0000000..18af006</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">--- /dev/null</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+++ b/test/CodeGen/XCore/byVal.ll</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">@@ -0,0 +1,57 @@</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+; RUN: llc < %s -march=xcore | FileCheck %s</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+; CHECK-LABEL: f0Test</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+; CHECK: entsp 1</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+; CHECK: bl f0</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+; CHECK: retsp 1</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+%struct.st0 = type { [0 x i32] }</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+declare void @f0(%struct.st0*) nounwind</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+define void @f0Test(%struct.st0* byval %s0) nounwind {</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+entry:</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+  call void @f0(%struct.st0* %s0) nounwind</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+  ret void</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+}</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+; CHECK-LABEL: f1Test</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+; CHECK: entsp 13</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+; CHECK: stw r4, sp[12]</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+; CHECK: stw r5, sp[11]</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+; CHECK: mov r4, r0</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+; CHECK: ldaw r5, sp[1]</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+; CHECK: ldc r2, 40</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+; CHECK: mov r0, r5</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+; CHECK: bl memcpy</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+; CHECK: mov r0, r5</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+; CHECK: bl f1</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+; CHECK: mov r0, r4</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+; CHECK: ldw r5, sp[11]</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+; CHECK: ldw r4, sp[12]</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+; CHECK: retsp 13</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+%struct.st1 = type { [10 x i32] }</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+declare void @f1(%struct.st1*) nounwind</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+define i32 @f1Test(i32 %i, %struct.st1* byval %s1) nounwind {</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+entry:</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+  call void @f1(%struct.st1* %s1) nounwind</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+  ret i32 %i</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+}</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+; CHECK-LABEL: f2Test</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+; CHECK: extsp 5</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+; CHECK: stw lr, sp[1]</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+; CHECK: stw r1, sp[3]</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+; CHECK: stw r2, sp[4]</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+; CHECK: stw r3, sp[5]</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+; CHECK: ldw r0, r0[0]</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+; CHECK: stw r0, sp[2]</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+; CHECK: ldaw r0, sp[2]</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+; CHECK: bl f2</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+; CHECK: ldw lr, sp[1]</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+; CHECK: ldaw sp, sp[5]</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+; CHECK: retsp 0</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+%struct.st2 = type { i32 }</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+declare void @f2(%struct.st2*) nounwind</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+define void @f2Test(%struct.st2* byval %s2, ...) nounwind {</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+entry:</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+  call void @f2(%struct.st2* %s2) nounwind</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+  ret void</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; ">+}</div>
</blockquote>
</div>
<div><br>
</div>
</body>
</html>