<div dir="ltr"><div>Sure!  The motivation is to properly implement non-trivial pass-by-value arguments in the Microsoft C++ ABI.  Without inalloca, it's impossible to represent the desired behavior in LLVM IR.  Specifically, we need to be able to call copy constructors on outgoing argument memory, or even better, elide the copy altogether and sret into it.</div>
<div><br></div>There's a longer document here:<div><a href="http://llvm.org/docs/InAlloca.html">http://llvm.org/docs/InAlloca.html</a><br></div><div><br></div><div>I think this bug covers it the best:</div><div><a href="http://llvm.org/bugs/show_bug.cgi?id=5064">http://llvm.org/bugs/show_bug.cgi?id=5064</a><br>
</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Dec 20, 2013 at 9:42 AM, Philip Reames <span dir="ltr"><<a href="mailto:listmail@philipreames.com" target="_blank">listmail@philipreames.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    <div>Reid,<br>
      <br>
      Out of curiosity, what's the motivation behind inalloca?  I found
      your update to the documentation which described their semantics,
      but I didn't find any discussion of when "inalloc" parameters
      would actually be useful.  Could you point me to the appropriate
      discussion thread?  Just trying to understand the motivation for
      the changes.<br>
      <br>
      Philip<div><div class="h5"><br>
      <br>
      On 12/19/13 2:43 PM, Reid Kleckner wrote:<br>
    </div></div></div>
    <blockquote type="cite"><div><div class="h5">
      <pre>I searched Transforms/ and Analysis/ for 'ByVal' and updated those call
sites to check for inalloca if appropriate.

I added tests for any change that would allow an optimization to fire on
inalloca.

<a href="http://llvm-reviews.chandlerc.com/D2449" target="_blank">http://llvm-reviews.chandlerc.com/D2449</a>

Files:
  include/llvm/IR/Argument.h
  include/llvm/IR/Instructions.h
  include/llvm/Support/CallSite.h
  lib/Analysis/MemoryBuiltins.cpp
  lib/Analysis/ValueTracking.cpp
  lib/IR/Function.cpp
  lib/IR/Instructions.cpp
  lib/Transforms/IPO/ArgumentPromotion.cpp
  lib/Transforms/IPO/DeadArgumentElimination.cpp
  lib/Transforms/IPO/FunctionAttrs.cpp
  lib/Transforms/IPO/IPConstantPropagation.cpp
  lib/Transforms/InstCombine/InstCombineCalls.cpp
  lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
  lib/Transforms/ObjCARC/ObjCARC.h
  lib/Transforms/Scalar/DeadStoreElimination.cpp
  test/Transforms/ArgumentPromotion/inalloca-2.ll
  test/Transforms/ArgumentPromotion/inalloca.ll
  test/Transforms/DeadStoreElimination/simple.ll
  test/Transforms/FunctionAttrs/readattrs.ll
</pre>
      <br>
      <fieldset></fieldset>
      <br>
      </div></div><pre>_______________________________________________
llvm-commits mailing list
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a>
</pre>
    </blockquote>
    <br>
  </div>

</blockquote></div><br></div>