[LLVMdev] Slow jitter.
Chris Lattner
clattner at apple.com
Tue Aug 25 14:16:06 PDT 2009
On Aug 25, 2009, at 1:40 PM, Óscar Fuentes wrote:
> While compiling some sources, translating from my compiler's IR to
> LLVM
> using the C++ API requires 2.5 seconds. If the resulting LLVM module
> is
> dumped as LLVM assembler, the file is 240,000 lines long. Generating
> LLVM code is fast.
>
> However, generating the native code is quite slow: 33 seconds. I force
> native code generation calling ExecutionEngine::getPointerToFunction
> for
> each function on the module.
>
> This is on x86/Windows/MinGW. The only pass is TargetData, so no fancy
> optimizations.
>
> I don't think that a static compiler (llvm-gcc, for instance) needs so
> much time for generating unoptimized native code for a similarly sized
> module. Is there something special about the JIT that makes it so
> slow?
The JIT uses the entire code generator, which uses N^2 algorithms etc
in some cases. If you care about compile time, I'd strongly suggest
using the "local" register allocator and the "-fast" mode. This is
what we do for -O0 compiles and it is much much faster than the
defaults. However, you get worse performing code out of the compiler.
-Chris
More information about the llvm-dev
mailing list