<div dir="ltr">+Lang for ORC JIT questions<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Nov 28, 2020 at 2:25 PM Sebastiano Miano via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Dear all,<br>
I am recently playing a little bit with the ORC JIT APIs with the goal<br>
of creating a prototype of a JIT compiler that loads the IR module of<br>
a C++ class, compiles it and instantiates the class.<br>
During the execution, I would like to replace some class methods by<br>
recompiling them with an optimized version.<br>
<br>
I have started from the latest version of the KaleidoscopeJIT, using<br>
the CompileOnDemandLayer to perform a lazy compilation of the class.<br>
I have managed successfully to load the code and instantiate the<br>
object, by getting the pointer of a "factory" method in the IR Module<br>
that returns the object itself.<br>
<br>
What I want to do now is to trigger the recompilation of a specific<br>
class method (i.e., function in the IR Module), and perform some IR<br>
transformations before the function is compiled. Then, I would like to<br>
point the old function to the new version (through the<br>
IndirectStubManager).<br>
The questions are:<br>
1. How can I trigger the re-optimization and re-compilation from the<br>
existing ExecutionSession? Is there a method in the<br>
CompileOnDemandLayer that allows it?<br>
2. Do I need to "manually" update the trampoline through the<br>
IndirectStubManager, or it is automatically done once the new function<br>
is compiled?<br>
<br>
Thanks a lot,<br>
Sebastiano<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>