<div dir="ltr">I think emails from <a href="mailto:rnk@google.com">rnk@google.com</a> are getting dropped somewhere along the way from phab to llvm-commits, so here's what I tried to send.  There's an updated patch.<div class="gmail_extra">
<br><br><div class="gmail_quote">On Fri, May 9, 2014 at 2:31 PM, Reid Kleckner <span dir="ltr"><<a href="mailto:rnk@google.com" target="_blank">rnk@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I looked for other backends that return sret parameters and found that mips and sparc do this.  Mips can be updated to handle sret on parameters other than the first, but sparc has more assumptions about sret, so I stuck in a report_fatal_error call.<br>

<div class=""><br>
================<br>
Comment at: lib/Target/X86/X86ISelLowering.cpp:2307<br>
@@ +2306,3 @@<br>
+    AttributeSet Attrs = MF.getFunction()->getAttributes();<br>
+    for (; I != E; ++I)<br>
+      if (Attrs.hasAttribute(I + 1, Attribute::StructRet))<br>
----------------<br>
</div><div class="">Rafael Ávila de Espíndola wrote:<br>
> Why the loop? If the rest of the code assumes that it is the first or second, it seems better to check only those too, or at least assert that I is 0 or 1.<br>
><br>
</div>I realized this loop was wrong anyway if codegen split the first parameter into multiple EVTs, like i64 to 2 i32s on a 32-bit platform.  I moved it up into the loop producing InVals and added a test for it.<br>
<br>
<a href="http://reviews.llvm.org/D3617" target="_blank">http://reviews.llvm.org/D3617</a><br>
<br>
<br>
</blockquote></div><br></div></div>