[LLVMdev] Missing ExecutionEngine EngineKind::MCJIT ?

Óscar Fuentes ofv at wanadoo.es
Sun Dec 23 03:59:30 PST 2012


Josh Klontz <josh.klontz at gmail.com> writes:

> Greetings, I have a simple C++ EDSL working using the JIT execution engine.
> When I upgraded to LLVM 3.2 (effortless upgrade, awesome stuff!) I thought I
> would try taking the MCJIT for a spin after having read that the JIT is
> considered to be "legacy".

The JIT is not legacy yet.

> So the changes I made to my code were:
> + #include <llvm/ExecutionEngine/MCJIT.h>
> - #include <llvm/ExecutionEngine/JIT.h>
> + llvm_map_components_to_libraries(REQ_LLVM_LIBRARIES mcjit native)
> - llvm_map_components_to_libraries(REQ_LLVM_LIBRARIES jit native)
>
> However the following call now returns NULL:
> EngineBuilder(TheModule).setEngineKind(EngineKind::JIT).setErrorStr(&error).create();

Don't remove `jit' from your LLVM component list above, even if you
plant to use MCJIT alone.

> There doesn't appear to be an EngineKind::MCJIT option. Am I missing
> something?

Use setUseMCJIT :

  [...] .setEngineKind(EngineKind::JIT).setUseMCJIT(true). [...]

> Should EDSL authors stick to the old JIT for now?

MCJIT is not on a par with the JIT yet, featurewise. And probably it
will never be. The most glaring difference is that MCJIT is not a
Just-In-Time compiler, it is more like an traditional compiler that
outputs the resulting code to RAM instead of the HD.

[snip]




More information about the llvm-dev mailing list