[LLVMdev] MC-JIT

Olivier Meurant meurant.olivier at gmail.com
Mon Jul 19 05:14:58 PDT 2010


Together with Jan Sjodin (in copy of this email), we begin an
implementation of the JIT with MC. The idea, suggested by Jan, is to
develop a MCJIT in parallel of the current JIT and to keep the two
implementations until (at least) the new MC one is mature enough.
Currently code is kept on gitorious
(http://gitorious.org/llvm-mc-jit/llvm-mc-jit).

Following this, a boolean "bool MCJIT = false" has been introduced to
the "static ExecutionEngine *create(...)" method, allowing the lli
tool to use the MCJIT with the optional flag "-mcjit".

The MCJIT can now execute little functions with no relocation (like
add(a,b) => a+b), to do that some modifications have been made :
- The addPassesToEmitMC method has been added to TargetMachine class.
It fills the MCContext pointer so we can build the MCJITStreamer.
- The Finish method of MCAssembler have a new optional argument
"Writer" to allow a custom MCJITObjectWriter to be used.

Can you give us some feedbacks on the general idea and on this 2
particular hooks ?


Currently MCJIT has one unittest and the binary size is quite big
(~110MB in debug...) because before using the MC framework we need to
call "InitializeAllTargets()" and friends (same as llc does). For the
JIT, we need only the "host" backend and "InitializeHostTarget()"-like
method doesn't seem to exist. Do you have an opinion on this ?

Attached you will find the patch introducing the first MCJIT draft.
Can you comment on this ?

Jan and Olivier.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mc_jit.patch
Type: text/x-patch
Size: 56702 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100719/545ebc04/attachment.bin>


More information about the llvm-dev mailing list