On Wed, 23 Nov 2005, Diego Novillo wrote:
On Tuesday 22 November 2005 13:17, Benjamin Kosnik wrote:
What about compile-time performance?
Well, it's hard to say, I have not really used LLVM extensively. The only
real data I have is compile times for SPECint:
SPECint build times (secs)
-O2 -O3
GCC 4.1.0 (20051117) 354 398
LLVM 1.6 (-Wl,-native-cbe) 802 805
So there appears to be a factor of 2 slowdown in LLVM. However, I know
LLVM has a separate GCC invokation. It seems as if it emitted C code that
is then compiled with GCC (I'm using -Wl,-native-cbe).
Wow, only 2x slowdown? That is pretty good, considering what this is
doing. I assume you're timing a release build here, not a debug build.
In any case, the LLVM time above includes the following:
1. An incredibly inefficient compile-time stage that is going away in the
newly integrated compiler. This involves producing a giant .ll file,
writing it to disk (cache) then parsing the whole thing back in. This
was a pretty expensive process that existed only to avoid linking LLVM
into GCC.
2. This time includes *full* linktime IPO (the old llvm-gcc wasn't
integrated well enough to have -O options :( ).
3. This time includes the time to convert the LLVM code to C, write out a
really large C file for the entire program, then fork/exec 'gcc -O2' on
the .c file.
Considering that the slowdown is only a factor of two with all that going
on, I think that's pretty impressive. :)
I don't think this would be standard procedure in an integrated LLVM.
Chris, how would one compare compile times? Not using -Wl,-native-cbe
implies emitting bytecode, right?
Correct, if you're timing build times, eliminating the -Wl,-native-cbe
will give you a sense for how expensive #3 is (which will just leave you
with LLVM .bc files). I suspect that it is about 30% or more of the
llvm-gcc time you report above. For another data point, you can compile
with '-Wl,-native' instead of -Wl,-native-cbe which will give you the LLVM
native X86 backend. It should be significantly faster and should provide
another interesting performance datapoint (though admitedly probably not
very good, due to the X86 backend needing work).
In any case, one of the major motivating factors is reduced compile times.
-Chris
--
http://nondot.org/sabre/
http://llvm.org/