[llvm-dev] MCJIT versus Orc

964 views
Skip to first unread message

Russell Wallace via llvm-dev

unread,
Mar 29, 2016, 3:15:59 PM3/29/16
to llvm-dev
When writing a JIT compiler using LLVM, as I understand it, you can use two alternative APIs, MCJIT and Orc. The latter offers lazy compilation. Would it be accurate to say that if you want eager compilation - always compile an entire module upfront - you should use MCJIT?

Justin Bogner via llvm-dev

unread,
Mar 29, 2016, 7:19:52 PM3/29/16
to Russell Wallace via llvm-dev, Lang Hames

+lang.

My understanding is that Orc is strictly more flexible than MCJIT. You
can, in fact, exactly implement the MCJIT API using the Orc APIs.

I think the general advice is that MCJIT's a bit more mature and stable,
but you probably want Orc in new code unless you really need that
maturity.
_______________________________________________
LLVM Developers mailing list
llvm...@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

Russell Wallace via llvm-dev

unread,
Mar 29, 2016, 7:22:06 PM3/29/16
to Justin Bogner, Russell Wallace via llvm-dev, Lang Hames
Right, but is there any known use case where Orc's flexibility allows something to be done that couldn't be with MCJIT, apart from lazy compilation?

Lang Hames via llvm-dev

unread,
Apr 4, 2016, 1:43:17 PM4/4/16
to Russell Wallace, Russell Wallace via llvm-dev, Lang Hames
Hi Russell,

Apologies for the delayed reply.

Orc's current advantages over MCJIT are:

(1) Built-in support for lazy compilation.
(2) Cleaner support for multi-module management, including un-loading modules.
(3) Much better memory management (depending on use-case, can consume far less memory for JIT'd code).

I expect Orc to gain further advantages over MCJIT in the future too.

I'd recommend using Orc rather than MCJIT.

- Lang.
 

Reply all
Reply to author
Forward
0 new messages