<div dir="ltr">Just found this in CoroSplit.cpp:<br><br>// Add musttail to any resume instructions that is immediately followed by a<br>// suspend (i.e. ret). We do this even in -O0 to support guaranteed tail call<br>// for symmetrical coroutine control transfer (C++ Coroutines TS extension).<br>// This transformation is done only in the resume part of the coroutine that has<br>// identical signature and calling convention as the coro.resume call.<br>static void addMustTailToCoroResumes(Function &F) {<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 1, 2018 at 10:46 PM, Andrew Kelley <span dir="ltr"><<a href="mailto:superjoe30@gmail.com" target="_blank">superjoe30@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div>It makes sense that you would be able to do this:<br><br></div>%save1 = llvm.coro.save()<br></div><div>%unused = musttail call llvm.coro.resume(%some_handle)<br></div>%x = llvm.coro.suspend()<br>... <br><br></div>But the docs for musttail say:<br>> The call must immediately precede a ret instruction, or a pointer bitcast followed by a ret instruction.</div><div><br></div><div>Should this be amended to allow a musttail to be followed by llvm.coro.suspend() ?</div><div><br></div><div>Regards,</div><div>Andrew<br></div></div>
</blockquote></div><br></div>