[LLVMdev] Some basic questions regarding MCJIT and Kaleidoscope sample

Dibyendu Majumdar mobile at majumdar.org.uk
Tue Feb 10 14:37:10 PST 2015


Hi David,

On 10 February 2015 at 22:14, David Blaikie  wrote:
> 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.
>

Yes I have noticed that there is a replacement for MCJIT using Orc.
But I assume this is still early days for the new api? When will a
production release be available?

Will Orc support the use case described in my post - i.e. - functions
independently JITed and garbage collected? In Lua,  function calls go
via the runtime so I don't need to link functions. Later on I will
look at inlining functions to be able to bypass the Lua runtime when
it makes sense.

The other requirement I have is to be able to access standard Lua
functions (not dynamically linked) from within the JITed function. I
discovered that MCJIT has the bug due to which addGlobalMapping() does
not work. So I am using sys::DynamicLibrary::AddSymbol() to register
the Lua functions.

BTW a newbie question - once I have compiled a function - is there a
need to retain the module and engine - apart from the fact that the
memory allocated to the JITed function is presumably managed by the
engine?

Thanks and Regards

Dibyendu



More information about the llvm-dev mailing list