<font size=2 face="sans-serif">Hello </font><font size=3>Lang</font><font size=2 face="sans-serif">,</font>
<br>
<br><font size=2 face="sans-serif">Thanks for your answer.</font>
<br>
<br><font size=2 face="sans-serif">I am now looking for an example of the
usage of CompileOnDemandLayer. Is there an example available for that (could
not find one in llvm/examples)?</font>
<br>
<br><font size=2 face="sans-serif">Thanks,</font>
<br><font size=2 face="sans-serif">Revital</font>
<br>
<br>
<br>
<br><font size=1 color=#5f5f5f face="sans-serif">From:
</font><font size=1 face="sans-serif">Lang Hames <lhames@gmail.com></font>
<br><font size=1 color=#5f5f5f face="sans-serif">To:
</font><font size=1 face="sans-serif">Revital1 Eres/Haifa/IBM@IBMIL</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Cc:
</font><font size=1 face="sans-serif">LLVM Developers Mailing
List <llvmdev@cs.uiuc.edu></font>
<br><font size=1 color=#5f5f5f face="sans-serif">Date:
</font><font size=1 face="sans-serif">10/07/2015 12:10 AM</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Subject:
</font><font size=1 face="sans-serif">Re: [LLVMdev]
Help with using LLVM to re-compile hot functions at run-time</font>
<br>
<hr noshade>
<br>
<br>
<br><font size=3>Hi Revital,</font>
<br>
<br><font size=3>LLVM does have an IR interpreter, but I don't think it's
maintained well (or possibly at all). The interpreter is also not designed
to interact with the LLVM JITs.</font>
<br>
<br><font size=3>We generally encourage people to just JIT LLVM IR, rather
than interpreting it. For the use-case you have described, you could JIT
IR with no optimizations to begin with, then re-JIT hot functions at a
higher level.</font>
<br>
<br><font size=3>The Orc JIT APIs (LLVM's newer JIT APIs) were written
with this kind of use-case in mind, and are probably a better fit for this
than MCJIT. There is no built-in hot-function detection or recompilation
yet, but I think this would be *fairly* easy to write in terms of Orc's
callback API.</font>
<br>
<br><font size=3>Cheers,</font>
<br><font size=3>Lang.</font>
<br>
<br>
<br><font size=3>On Thu, Jul 9, 2015 at 4:19 AM, Revital1 Eres <</font><a href=mailto:ERES@il.ibm.com target=_blank><font size=3 color=blue><u>ERES@il.ibm.com</u></font></a><font size=3>>
wrote:</font>
<br><font size=2 face="sans-serif">Hello,</font><font size=3> <br>
</font><font size=2 face="sans-serif"><br>
I am new to LLVM and a I appreciate your help with the following:</font><font size=3>
<br>
</font><font size=2 face="sans-serif"><br>
I want to run the LLVM IR through virtual machine (LLVM interpreter?) and
jit</font><font size=3> </font><font size=2 face="sans-serif"><br>
compile the hot functions (using MCJIT).</font><font size=3> <br>
</font><font size=2 face="sans-serif"><br>
This task will require amongst other identifying the hot functions and
having a</font><font size=3> </font><font size=2 face="sans-serif"><br>
code cache that should be patched with the native code of the functions
after</font><font size=3> </font><font size=2 face="sans-serif"><br>
they are jitted.</font><font size=3> <br>
</font><font size=2 face="sans-serif"><br>
I've read so far about MCJIT and lli however I have not seen that the LLVM
<br>
interpreter can be used as a VM the way I was looking for; meaning</font><font size=3>
</font><font size=2 face="sans-serif"><br>
execute the code one instruction at a time; have a profiling mode to <br>
identify hot functions and call jit to compile the hot functions.</font><font size=3>
<br>
</font><font size=2 face="sans-serif"><br>
I appreciate any advice/starting points for this project.</font><font size=3>
<br>
</font><font size=2 face="sans-serif"><br>
Thanks,</font><font size=3> </font><font size=2 face="sans-serif"><br>
Revital</font><font size=3> <br>
<br>
_______________________________________________<br>
LLVM Developers mailing list</font><font size=3 color=blue><u><br>
</u></font><a href=mailto:LLVMdev@cs.uiuc.edu><font size=3 color=blue><u>LLVMdev@cs.uiuc.edu</u></font></a><font size=3>
</font><a href=http://llvm.cs.uiuc.edu/ target=_blank><font size=3 color=blue><u>http://llvm.cs.uiuc.edu</u></font></a><font size=3 color=blue><u><br>
</u></font><a href=http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev target=_blank><font size=3 color=blue><u>http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</u></font></a><font size=3><br>
</font>
<br>
<br>
<br>