<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p><font face="Hack Nerd Font Mono">The conditional seems to have
been there for a long time
(450aa64fc1878b55f0715c8672c59dac2e312beb).</font></p>
<p>Though, it seems odd we say `speculatable` calls are
automatically in a tail position. They can also not always be
moved to one.</p>
<p>I would not be surprised if all tests pass if you remove the
outer conditional, especially since we do not yet derive
speculatable.</p>
<p><br>
</p>
<p>Maybe someone more active in this area can chime in.<br>
</p>
<p><br>
</p>
<p>Cheers,</p>
<p> Johannes<br>
</p>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">On 5/15/20 9:06 PM, Victor Huang via
llvm-dev wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CA+AC39q=v5d3SeXi+2Z_ozbeE61=RVx-J8Qrnu48npH+J_WG7A@mail.gmail.com">
<pre class="moz-quote-pre" wrap="">Hi All,
We are encountering an issue where "bool llvm::isInTailCallPosition()" returns
true for a callee not in a tail call position.
The function "bool llvm::isInTailCallPosition()" (
<a class="moz-txt-link-freetext" href="https://pastebin.com/fMxAsh95">https://pastebin.com/fMxAsh95</a>) only checks whether a call is in a tail call
position if the call has side effects, accesses memory or is not safe to
speculatively execute. Therefore, a “speculatable” function will always be
considered in a tail-call position - regardless of whether it actually is.
A small example as below:
IR reproducer <a class="moz-txt-link-freetext" href="https://pastebin.com/eZwVxr2K">https://pastebin.com/eZwVxr2K</a> produces a tail call in caller
without storing the result, which can be seen in the initial SDAG shared
below:
<a class="moz-txt-link-freetext" href="https://pastebin.com/SnyKHeZT">https://pastebin.com/SnyKHeZT</a>
Any ideas or suggestions?
Thanks,
Victor
</pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a>
</pre>
</blockquote>
</body>
</html>