<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jul 9, 2010, at 3:25 PM, Rafael Espindola wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><blockquote type="cite">But it's not the stack pointer itself that you care about here, it's the<br></blockquote><blockquote type="cite">alignment of whatever the prior argument was. So you really want to know<br></blockquote><blockquote type="cite">"What's the least alignment of any argument?" That's why I thought<br></blockquote><blockquote type="cite">getCallFrameTypeAlignment would work. If it's not returning the right<br></blockquote><blockquote type="cite">value, that may be a bug.<br></blockquote><br>On IRC we agreed that we need yet another alignment type :-(<br><br>The attached patch adds MinStackArgumentAlignment to<br>TargetLoweringInfo and uses that. I also extended the test a bit to<br>check that only the necessary alignment is added.<br></div></blockquote><div><br></div><div>Two minor comments:</div><div><br></div><div><blockquote type="cite"><div><font class="Apple-style-span" color="#000000">@@ -1515,6 +1527,11 @@ private:</font></div><div><font class="Apple-style-span" color="#000000">   /// buffers</font></div><div><font class="Apple-style-span" color="#000000">   unsigned JumpBufAlignment;</font></div><div><font class="Apple-style-span" color="#000000"> </font></div><div><font class="Apple-style-span" color="#000000">+  /// MinStackArgumentAlignment - The minimum alginment that any argument</font></div></blockquote><div><br></div>typo: "alginment"</div><div><br><blockquote type="cite"><div><font class="Apple-style-span" color="#000000">+  /// on the stack needs to have.</font></div><div><font class="Apple-style-span" color="#000000">+  ///</font></div><div><font class="Apple-style-span" color="#000000">+  unsigned MinStackArgumentAlignment;</font></div><div><font class="Apple-style-span" color="#000000">+</font></div><div><font class="Apple-style-span" color="#000000">   /// PrefLoopAlignment - The perferred loop alignment.</font></div><div><font class="Apple-style-span" color="#000000">   ///</font></div><div><font class="Apple-style-span" color="#000000">   unsigned PrefLoopAlignment;</font></div></blockquote><div><div><br></div></div></div><div><br></div><div><blockquote type="cite"><div><font class="Apple-style-span" color="#000000">@@ -5736,7 +5736,8 @@ void SelectionDAGBuilder::visitVAStart(const CallInst &I) {</font></div><div><font class="Apple-style-span" color="#000000"> void SelectionDAGBuilder::visitVAArg(const VAArgInst &I) {</font></div><div><font class="Apple-style-span" color="#000000">   SDValue V = DAG.getVAArg(TLI.getValueType(I.getType()), getCurDebugLoc(),</font></div><div><font class="Apple-style-span" color="#000000">                            getRoot(), getValue(I.getOperand(0)),</font></div><div><font class="Apple-style-span" color="#000000">-                           DAG.getSrcValue(I.getOperand(0)));</font></div><div><font class="Apple-style-span" color="#000000">+                           DAG.getSrcValue(I.getOperand(0)),</font></div><div><font class="Apple-style-span" color="#000000">+                           TLI.getTargetData()->getABITypeAlignment(I.getType()));</font></div></blockquote><br><div>width exceeds 80 columns</div><div><br></div><blockquote type="cite"><div><font class="Apple-style-span" color="#000000">   setValue(&I, V);</font></div><div><font class="Apple-style-span" color="#000000">   DAG.setRoot(V.getValue(1));</font></div><div><font class="Apple-style-span" color="#000000"> }</font></div></blockquote><div><div><br></div></div></div></div></body></html>