[LLVMdev] MCJIT and Lazy Function Creators

Óscar Fuentes ofv at wanadoo.es
Mon Nov 26 17:09:11 PST 2012


Óscar Fuentes <ofv at wanadoo.es> writes:

> Out of curiosity, I'm replacing the JIT with MCJIT on my compiler. As
> all "external" functions are provided by the language's FFI mechanism,
> it does
>
> MyExecutionEngine->DisableSymbolSearching();
> MyExecutionEngine->InstallLazyFunctionCreator(&MyLazyFunctionCreator);
>
> which works fine with the JIT. However, MCJIT insists on resolving
> unknown symbols by searching them outdoors and seems oblivious of the
> existence of MyLazyFunctionCreator.
>
> Is this a bug?
>
> Is there a workaround, other than subclassing JITMemoryManager and
> implementing my own getPointerToNamedFunction? (which would make the
> existence of ExecutionEngine::InstallLazyFunctionCreator pointless.)

After working around the issue mentioned above by subclassing
JITMemoryManager, I hit another roadblock:

Full-featured argument passing not supported yet!
UNREACHABLE executed at /home/oscar/dev/llvm/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp:272!

That's from MCJIT::runFunction. The argument has type [i x i8]*, but
there are llvm_unreachable calls for other cases, including varargs,
integer types larger than 64 bits and long doubles.




More information about the llvm-dev mailing list