<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2017-06-02 19:51 GMT+08:00 David Chisnall <span dir="ltr"><<a href="mailto:David.Chisnall@cl.cam.ac.uk" target="_blank">David.Chisnall@cl.cam.ac.uk</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">On 2 Jun 2017, at 03:38, TONGARI J via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br>
><br>
> I'm aware of the invoke instruction and landingpad. But it's too heavy<br>
> weight for control flow. It's quite expensive to take the exceptional path<br>
> in C++.<br>
><br>
> What I want is a more lightweight approach, to pass the return address to<br>
> the callee, and let the callee jump to that address directly.<br>
<br>
</span>The best way of implementing this is likely to be to use a custom calling convention along with invoke.  The invoke instruction will handle the semantics correctly in the IR, but you’ll need to modify the back end to understand that it should generate the call site differently and not emit unwind tables.<br></blockquote><div> </div><div>A custom calling convention doesn't suffice, there could be more than one alternate paths. And invoke instruction is also not general enough.</div></div></div></div>