<div dir="ltr">ping</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Apr 16, 2014 at 2:59 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">Hi chandlerc,<br>
<br>
This is essentially a partial revert of r105255, which fixed PR7272.<br>
The test case it introduced[1] still passes:<br>
  test/Transforms/Inline/2010-05-31-ByvalTailcall.ll<br>
<br>
I think this was misdiagnosed.  The call to @ext in the test case should<br>
never have been marked 'tail' by instcombine, tailcallelim, or any other<br>
optimization because it captures a byval argument, which is using memory<br>
from the caller.  That's against the LangRef rules for tail calls.  It<br>
looks like the optimization that added the tail flag has been fixed in<br>
the meantime, because the test still passes.<br>
<br>
<a href="http://reviews.llvm.org/D3403" target="_blank">http://reviews.llvm.org/D3403</a><br>
<br>
Files:<br>
  lib/Transforms/Utils/InlineFunction.cpp<br>
<br>
Index: lib/Transforms/Utils/InlineFunction.cpp<br>
===================================================================<br>
--- lib/Transforms/Utils/InlineFunction.cpp<br>
+++ lib/Transforms/Utils/InlineFunction.cpp<br>
@@ -586,15 +586,8 @@<br>
       if (CS.isByValArgument(ArgNo)) {<br>
         ActualArg = HandleByValArgument(ActualArg, TheCall, CalledFunc, IFI,<br>
                                         CalledFunc->getParamAlignment(ArgNo+1));<br>
-<br>
-        // Calls that we inline may use the new alloca, so we need to clear<br>
-        // their 'tail' flags if HandleByValArgument introduced a new alloca and<br>
-        // the callee has calls.<br>
-        if (ActualArg != *AI) {<br>
-          MustClearTailCallFlags = true;<br>
+        if (ActualArg != *AI)<br>
           ByValInit.push_back(std::make_pair(ActualArg, (Value*) *AI));<br>
-        }<br>
-<br>
       }<br>
<br>
       VMap[I] = ActualArg;<br>
</blockquote></div><br></div>