[LLVMdev] Should LLVM JIT default to lazy or non-lazy?

Óscar Fuentes ofv at wanadoo.es
Wed Oct 28 11:16:16 PDT 2009


Jeffrey Yasskin <jyasskin at google.com> writes:

[snip]

> Thoughts?

I didn't notice the existence of a parameter for disabling JIT
laziness. What I do on my code is

    for (Module::iterator it = M->begin(); it != M->end(); ++it)
      EE->getPointerToFunction(&*it);

thus forcing code emission for all functions.

Native code creation on x86/x86_64 not only is very slow, its time
complexity for N LLVM instructions is N^x (x > 1). For a project I'm
working on, the JIT takes almost 1 minute to emit native code for all
functions on a low-end machine. That application acts as a server, and
clients will time-out if it takes more than a few seconds to respond,
which is very likely to happen with a lazy JIT. This is almost as bad as
the thread-safety issue, when the time required for lazy JITting is
similar to the time-out threshold.

IMHO it would be better for LLVM to default to non-lazy JITting.

-- 
Óscar




More information about the llvm-dev mailing list