performance of LLVM?

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

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?

I'm not sure. I don't know of any that have switched to llvm.

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

The Mesa OpenGL stack is apparently switching to use LLVM. Also, llvm-gcc is opensource and produces large assembly files for large programs.

It's hard to know exactly what you're asking for here... I suspect it comes down to having to benchmark the specific thing you're interested in to find out for sure.

-Chris

Chris Lattner wrote:

For a mini functional language in LLVM see:

http://groups.google.com/group/fa.caml/browse_frm/thread/8ba2204855fc5e46#5aee553df34548e2

AFAIK no major functional/logic implementations have moved to LLVM, but I'd
be interested to hear to the contrary.

Basile Starynkevitch wrote: