[LLVMdev] Forcing JIT of all functions before execution starts
Chris Lattner
sabre at nondot.org
Sat Jul 28 00:44:52 PDT 2007
On Fri, 27 Jul 2007, Sarah Thompson wrote:
> (I have verified that just going through all the Functions in the Module
> and calling getPointerToFunction for each in turn actually seems to work
> -- I just wanted to make sure that this is sensible)
Yep, that is both sensible and is the recommended approach. However, the
JIT should lock itself (using pthreads calls) to prevent itself from dying
in a multithreaded situation. If you're using pthreads then you found a
bug.
One feature you might be interested in is the EE->DisableLazyCompilation()
method. This will cause the jit to abort if you ever ask it to do lazy
compilation. This is a useful 'assertion' mode if you think your code
should compile everything ahead of time and want to know if you ever
forgot something. :)
-Chris
--
http://nondot.org/sabre/
http://llvm.org/
More information about the llvm-dev
mailing list