<div dir="ltr">Hi Revital,<div><br></div><div>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.</div><div><br></div><div>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.</div><div><br></div><div>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.</div><div><br></div><div>Cheers,</div><div>Lang.</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 9, 2015 at 4:19 AM, Revital1 Eres <span dir="ltr"><<a href="mailto:ERES@il.ibm.com" target="_blank">ERES@il.ibm.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><font size="2" face="sans-serif">Hello,</font>
<br>
<br><font size="2" face="sans-serif">I am new to LLVM and a I appreciate
your help with the following:</font>
<br>
<br><font size="2" face="sans-serif">I want to run the LLVM IR through virtual
machine (LLVM interpreter?) and jit</font>
<br><font size="2" face="sans-serif">compile the hot functions (using MCJIT).</font>
<br>
<br><font size="2" face="sans-serif">This task will require amongst other
identifying the hot functions and having a</font>
<br><font size="2" face="sans-serif">code cache that should be patched with
the native code of the functions after</font>
<br><font size="2" face="sans-serif">they are jitted.</font>
<br>
<br><font size="2" face="sans-serif">I've read so far about MCJIT and lli
however I have not seen that the LLVM </font>
<br><font size="2" face="sans-serif">interpreter can be used as a VM the
way I was looking for; meaning</font>
<br><font size="2" face="sans-serif">execute the code one instruction at
a time; have a profiling mode to </font>
<br><font size="2" face="sans-serif">identify hot functions and call jit
to compile the hot functions.</font>
<br>
<br><font size="2" face="sans-serif">I appreciate any advice/starting points
for this project.</font>
<br>
<br><font size="2" face="sans-serif">Thanks,</font>
<br><font size="2" face="sans-serif">Revital</font>
<br><br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu" rel="noreferrer" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" rel="noreferrer" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><br></div>