[LLVMdev] performance of LLVM?

Basile STARYNKEVITCH basile at starynkevitch.net
Sat Nov 3 08:04:38 PDT 2007


Hello All,

I suspect that LLVM performs very well, mostly because I respect a lot 
his main architect Chris.

However, I have no ideas about concrete performance of the LLVM 
compiler, in particular speed of the compilation process to achieve 
small optimisation (mostly something equivalent to gcc -fPIC -O1 in 
terms of code quality). The intent is to generated .so files (I want to 
avoid the LLVM JIT stuff because linking in the LLVM compiler is huge, 
and handling the LLVM representation may be more difficult than printing 
LLVM assembly file).

I know my question is a bit vague, but to make it more precise, assuming 
one generate either low level C code or LLVM assembly code (or perhaps 
C-- code, all these are somehow similar) from a higher level stuff 
(think of some Scheme -> C or Prolog -> C compiler or Mercury -> C 
compiler).

The typical style of the generated code could be something in a "GIMPLE" 
style in all cases. So each instruction is either some simple 
arithmetic, or some simple test, or one call (but no nested call).


My intuition is thus that in order to achieve rather good compilation 
time and not bad runtime behavior of the generated code, compiling (with 
LLVM) generated LLVM assembly should be quicker than compiling the 
equivalent generated low level C code.

In other words, are there some successful code "generators" (ie high 
level compilers for either functional or logical languages) which 
actually did switch from generating C code and compiling it (with GCC) 
to generating LLVM assembly and compiling it (with LLVM)? What are the 
concrete improvements (in compilation time by LLVM or GCC, and in code 
generation time) they observed?


Are there today some opensource programs which generate big LLVM 
assembly files?

NB: in this email, a code generator means actually a complex program 
which transform a high level language (Prolog, Haskell, Scheme, ...) 
into a lower level one (C or LLVM assembly or C--).


-- 
Basile STARYNKEVITCH         http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mines, sont seulement les miennes} ***



More information about the llvm-dev mailing list