[llvm-dev] How to insert instructions before each function calls?

SHUCAI YAO via llvm-dev llvm-dev at lists.llvm.org
Mon Sep 19 08:39:00 PDT 2016


Hi Dean,

Thank you very much.  I solved my problems by using the similar structure.

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:

1. t = getDirectionalLocalSymbol  first;

2. jmp t

3. then emit  nops

4. createDirectionalLocalSymbol(t)

Hope it can help.

Thank you!
Shucai

On Mon, Sep 5, 2016 at 9:21 PM, Dean Michael Berris <dean.berris at gmail.com>
wrote:

> > On 5 Sep 2016, at 16:14, SHUCAI YAO <yaos4 at mcmaster.ca> wrote:
> >
> >
> > Hi Dean,
> >
> > Do you have any example for this?  I would like have a look at how you
> handle this in XRay if it is possible.
> >
>
> 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.cpp
> and/or search for PATCHABLE_RET in include/... and lib/... then that should
> give you a better idea of how this works. :)
>
> Cheers
>
> -- Dean
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160919/ca3d08eb/attachment.html>


More information about the llvm-dev mailing list