[LLVMdev] MCJIT and Lazy Function Creators

Kaylor, Andrew andrew.kaylor at intel.com
Tue Nov 27 11:08:55 PST 2012

I guess we'll have to add that to the list of things that needs to be done to replace the old JIT.

In the projects I've worked on that use MCJIT, we've been using getPointerToFunction and then calling it from outside the MCJIT engine, but I suppose that the generic handling in runFunction would be useful in some cases.


-----Original Message-----
From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of Óscar Fuentes
Sent: Monday, November 26, 2012 5:09 PM
To: llvmdev at cs.uiuc.edu
Subject: Re: [LLVMdev] MCJIT and Lazy Function Creators

Ó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.

LLVM Developers mailing list
LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu

More information about the llvm-dev mailing list