<div dir="ltr">We (and by 'we' I mean 'Lang' (cc'd)) have recently been experimenting with improvements/replacements to the MCJIT in the form of Orc, a new layered, composable JIT API. There are examples of this in the Kaleidoscope code samples (llvm/examples/Kaleidoscope/Orc) though not comprehensive tutorials as yet.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 10, 2015 at 1:57 PM, Dibyendu Majumdar <span dir="ltr"><<a href="mailto:mobile@majumdar.org.uk" target="_blank">mobile@majumdar.org.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I am building a new JIT compiler for Lua (actually a derivative of<br>
Lua), and am planning to use LLVM for this. I have trying out some<br>
basic functions using LLVM 3.5.1. I have been puzzled by one aspect of<br>
the MCJIT versions of the Kaleidoscope sample, and would hugely<br>
appreciate some insight.<br>
<br>
Can a single MCJIT instance be used to manage several modules?<br>
Why is a separate MCJIT instance created for each module?<br>
<br>
Unfortunately the tutorial text does not explain the rationale for this.<br>
<br>
At the moment in my implementation I am putting each compiled function<br>
in its own module and creating an engine for it. This is so that each<br>
function can be managed independently and linked to garbage collection<br>
in Lua. However I do not know if there is a better way - for example<br>
creating a shared engine across all modules. I would also like to<br>
understand the trade offs with this approach versus other approaches.<br>
<br>
Many thanks<br>
<br>
Regards<br>
Dibyendu<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" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
</blockquote></div><br></div>