[cfe-commits] r69755 - in /cfe/trunk: include/clang/Frontend/PCHBitCodes.h include/clang/Frontend/PCHReader.h include/clang/Frontend/PCHWriter.h lib/Frontend/PCHReader.cpp lib/Frontend/PCHWriter.cpp

Douglas Gregor dgregor at apple.com
Tue Apr 21 17:46:46 PDT 2009

On Apr 21, 2009, at 5:21 PM, Chris Lattner wrote:

> On Apr 21, 2009, at 4:56 PM, Douglas Gregor wrote:
>> Author: dgregor
>> Date: Tue Apr 21 18:56:24 2009
>> New Revision: 69755
>> URL: http://llvm.org/viewvc/llvm-project?rev=69755&view=rev
>> Log:
>> Lazy deserialization of macro definitions for precompiled headers.
>> This optimization improves performance on the Carbon-prefixed "Hello,
>> World!" example by 57%. For reference, we're now about 2.25x faster
>> than GCC PCH. We're also pulling in far less of the PCH file:
>> *** PCH Statistics:
>> 411/20693 types read (1.986179%)
>> 2553/59230 declarations read (4.310316%)
>> 1093/44646 identifiers read (2.448148%)
>> 1/32954 statements read (0.003035%)
>> 21/6187 macros read (0.339421%)
> Very nice!  Why are we still pulling in thousands of identifiers and  
> decls?

291 of them are __builtin_* identifiers, for which we built  
declarations within the PCH file. These are getting loaded eagerly due  
to some ordering issues (e.g., we initialize builtins before we have a  
chance to intercept IdentifierInfo construction).  There are similar  
issues with other library builtins or library functions we know about  
(e.g., printf). That's probably the bulk of the declarations being  
read in.

There are a few other oddities in there... I see some keywords (!)  
that I'll obviously need to get rid of.

We're also pulling in the declarations of inline functions, so that we  
can tell CodeGen about them. It's *possible* that we don't need to do  
this. I'll think about it some more.

	- Doug

More information about the cfe-commits mailing list