<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jul 7, 2016, at 8:36 PM, Gerolf Hoflehner <<a href="mailto:ghoflehner@apple.com" class="">ghoflehner@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Ahmed pointed out the clang commit causing the issue is <span style="background-color: rgb(255, 255, 255);" class="">r244207 - Mark calls in thunk functions as tail-call optimization candidates</span><div class=""><br class=""></div><div class="">The purpose of the fix was to prevent thunks from showing up on the call stack.</div><div class=""><br class=""></div><div class="">It seems that this patch overlooked the implications of tail calls with byval parameters and should be backed out. Any objections?</div><div class=""><br class=""></div><div class="">Thanks</div><div class="">Gerolf</div><div class=""><br class=""></div><div class=""><div class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Jul 5, 2016, at 4:50 PM, Gerolf Hoflehner via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Sounds reasonable. I’m curious what others think. For a thunk a tail call makes sense, but a byval in tail call needs at least a clarification in the IR specification. Similar, when a byval is not allowed in a tail call. That should be checked by the IR verifier then, too.<div class=""><br class=""></div><div class="">Thanks</div><div class="">Gerolf</div><div class=""><br class=""></div><div class=""><div class=""><blockquote type="cite" class=""><div class="">On Jul 2, 2016, at 7:16 PM, Eli Friedman <<a href="mailto:eli.friedman@gmail.com" class="">eli.friedman@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class="gmail_extra"><div class="gmail_quote">On Sat, Jul 2, 2016 at 6:35 PM, Gerolf Hoflehner<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:ghoflehner@apple.com" target="_blank" class="">ghoflehner@apple.com</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><br class=""><br class="">Sent from my iPhone<br class=""><span class=""><br class="">> On Jul 2, 2016, at 5:15 PM, Eli Friedman <<a href="mailto:eli.friedman@gmail.com" class="">eli.friedman@gmail.com</a>> wrote:<br class="">><br class="">> eli.friedman added a subscriber: eli.friedman.<br class="">> eli.friedman added a comment.<br class="">><br class="">> Special-casing this in DSE makes no sense... alias analysis should always return the correct result.<br class="">><br class="">> In this case, alias analysis is correct; the definition of "tail" doesn't allow marking this call.<br class=""><br class=""></span>Why?<br class=""><div class=""><div class="h5"><br class=""></div></div></blockquote><div class=""><br class="">It could work in theory, but in practice it isn't documented in LangRef and isn't actually supported by the current implementation; tailcallelim doesn't mark calls with byval arguments as "tail", optimization passes aren't expecting it, and targets aren't expecting it.  I mean, it could be changed, but it's not just a simple bugfix.<br class=""><br class=""></div><div class="">-Eli</div></div></div></div></div></blockquote></div><br class=""></div></div>_______________________________________________<br class="">llvm-commits mailing list<br class=""><a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a><br class=""><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br class=""></div></blockquote></div><br class=""></div></div></div></div></blockquote></div><br class=""></body></html>