[LLVMdev] -O0 compile time speed (was: Go)

Arnt Gulbrandsen arnt at gulbrandsen.priv.no
Sun Nov 22 08:08:02 PST 2009


Chris Lattner writes:
> On Nov 21, 2009, at 1:00 PM, Arnt Gulbrandsen wrote:
>
>>  Chris Lattner writes:
>>>  I'm still really interested in making Clang (and thus LLVM) faster 
>>>  at -O0 (while still preserving debuggability of course).
>>
>>  Why?
>
> I want the compiler to build things quickly in all modes, but -O0 in 
> particular is important for a fast compile/debug/edit cycle. Are you 
> asking why fast compilers are good?

Sort of. Why you think more speed than LLVM currently provides is a 
significant benefit.

Here's a suggestion, anyway. Teach LLVM to store an optional 
input-related opaque byte array for each symbol. Define it only as 
something of arbitrary size that must change if it exists and the 
source changes.

In clang, use that to store the preprocessed source for each function, 
and if clang sees that the byte array in the output file is the same as 
its preprocessed source, it can leave the output and skip compiling 
that function. Then think hard about how this can be extended to skip 
some optimisation passes too.

Someone else said that nothing beats a splat compiler except another 
splat compiler. I think a compiler that mostly avoids compiling may 
have a fair chance.

Arnt



More information about the llvm-dev mailing list