<div dir="ltr"><div><font color="#500050"><span style="font-size:12.8px"><br></span></font></div><font color="#500050"><span style="font-size:12.8px">Hi Dean,</span></font><div><font color="#500050"><span style="font-size:12.8px"><br></span></font></div><div><font color="#500050"><span style="font-size:12.8px">Thank you very much.  I solved my problems by using the similar structure. </span></font></div><div><font color="#500050"><span style="font-size:12.8px"><br></span></font></div><div><font color="#500050"><span style="font-size:12.8px">BTW, I saw there is a hacky way to do the relative jump in function of LowerPATCHABLE_FUNCTION_ENTER. I think directional local symbol can implement it too: </span></font></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><font color="#500050"><span style="font-size:12.8px">1. t = </span></font>getDirectionalLocalSymbol<font color="#500050"><span style="font-size:12.8px">  first; </span></font></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><font color="#500050"><span style="font-size:12.8px">2. jmp t</span></font></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><font color="#500050"><span style="font-size:12.8px">3. then emit  nops</span></font></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><font color="#500050"><span style="font-size:12.8px">4. </span></font>createDirectionalLocalSymbol(t)</div><div><br></div></blockquote>Hope it can help. <div><br></div><div>Thank you!</div><div>Shucai</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 5, 2016 at 9:21 PM, Dean Michael Berris <span dir="ltr"><<a href="mailto:dean.berris@gmail.com" target="_blank">dean.berris@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">> On 5 Sep 2016, at 16:14, SHUCAI YAO <<a href="mailto:yaos4@mcmaster.ca">yaos4@mcmaster.ca</a>> wrote:<br>
><br>
><br>
> Hi Dean,<br>
><br>
> Do you have any example for this?  I would like have a look at how you handle this in XRay if it is possible.<br>
><br>
<br>
</span>Yes, this is all upstream -- if you look in lib/CodeGen/XRayInstrument.cpp and the associated lowering code for X86 in lib/Target/X86/X86MCInstLower.<wbr>cpp and/or search for PATCHABLE_RET in include/... and lib/... then that should give you a better idea of how this works. :)<br>
<br>
Cheers<br>
<span class="HOEnZb"><font color="#888888"><br>
-- Dean<br>
<br>
<br>
</font></span></blockquote></div><br></div>