<div dir="ltr">HI <span style="font-size:13px">Dibyendu,</span><div><span style="font-size:13px"><br></span></div><div>A single MCJIT instance can notionally manage multiple modules, but there are caveats (which I'm afraid I don't remember off the top of my head) that make it unattractive in practice. I believe most clients opt for something like the ExecutionEngine-per-Module model used in the Kaleidoscope tutorials.</div><div><br></div><div>As Dave mentioned, I'm also working on some new JIT APIs (Orc) that are intended to be more feature-rich and easier to use than MCJIT. If you would like to try them out and have any questions about how they work please don't hesitate to ask. You'll need to live on the bleeding edge for those though - they're not available on 3.5.</div><div><br></div><div>Cheers,</div><div>Lang.</div><div> </div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 10, 2015 at 2:14 PM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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="HOEnZb"><div class="h5"><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" target="_blank">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>
</div></div></blockquote></div><br></div>