On Tue, 22 Nov 2005, Benjamin Kosnik wrote:
Another minor nit is performance. Judging by SPEC, LLVM has some performance problems. It's very good for floating point (a 9% advantage over GCC), but GCC has a 24% advantage over LLVM 1.2 in integer code. I'm sure that is fixable and I only have data for an old release of LLVM. But is still more work to be done. Particularly for targets not yet supported by LLVM.
First off, this is for an extremely old version of LLVM (1.5yrs old, which represents 1/3 of LLVM's life :).
For a better picture, you can take a look at some of the PowerPC numbers here: http://persephone.cs.uiuc.edu/~oscar/nightlytest/
It's hard to decode for people who are not used to staring at the Tables, but overall, LLVM is about 10-20% win over GCC (rough numbers) on PPC. The X86 backend is getting more investment now, as it has been without a maintainer for quite a while. I don't think its performance is as good as the PPC backend yet. In any case, going to RTL solves that issue.
What about compile-time performance?
LLVM has very good compile-time performance overall, and is one of the reasons that Apple is interested in it. It was designed with modern principles, and has had the advantage of not having to worry about legacy code to maintain. For -O0 compiles for example, I'm targeting a 20% speedup in the backend vs GCC 4 (using the native LLVM code generators).
The individual LLVM optimizers are almost all very fast (though a couple need to be tuned), and the link-time stages are all quite fast (though obviously not as fast as not doing link-time optzn). For some examples, you can check out my thesis work, which is doing extremely aggressive context sensitive analysis and datastructure transformations in 3-4% of GCC compile times (i.e., single digit seconds for large programs like gcc). When dealing with large programs, it's "just" a matter of using good algorithms and data structures: there is no other solution.
OTOH the specific questions about link-time compile-time performance, as others have pointed out, are not really that interesting. They would only be enabled at -O4 (or something) and the other link-time proposal would also have a substantial impact on compile-times (I posit that it will be far worse than compile times using LLVM). Besides using good algorithms and data structures, there is nothing you can do. Doing optimization at link time *will* be slower than doing it at compile time: the question is just how much.
I'd actually like to make this a requirement, regardless of the option chosen.
Agreed. For my work at Apple at least, compile-times are a very important part of the work (and one of the direct motivators).
-Chris -- http://nondot.org/sabre/ http://llvm.org/