[llvm-commits] [llvm-gcc-4.2] r53130 - /llvm-gcc-4.2/trunk/gcc/cgraphunit.c
Dale Johannesen
dalej at apple.com
Tue Jul 8 10:40:15 PDT 2008
On Jul 4, 2008, at 9:38 AMPDT, Duncan Sands wrote:
> Sorry, problems with my email client :) Here it is
> again, hopefully readable...
>
> Hi Dale,
>
>> Do not emit unreferenced static functions at -O0.
>> This is the gcc-4.0 behavior, changed deliberately
>> in gcc-4.2, see PR 24561. After discussion Chris,
>> Evan and I agreed the 4.0 behavior is better so
>> we're going back to that.
>
> is there a similar issue with dead static globals?
The behavior is that dead static globals are removed in C++ at all
optimization levels; this is the same across gcc-4.0, gcc-4.2, and
llvm-gcc.
In C they are not removed at -O0; gcc-4.2 and llvm-gcc remove them at
higher optimization levels, and gcc-4.0 does not.
My guess is that, since the processing involved for data objects is
considerably less than that for functions, whatever you do here is not
going to matter much to compile time. That might not be true for big
initialized static objects, especially given llvm IR's bulky notation
for them, but how common can that be (unreferenced)? I have no data
to support my opinion, however.
> Also, how much of a win is this?
I don't know. It showed up on a profile as a place where time was
being spent, maybe the guys who made the profile have some idea.
More information about the llvm-commits
mailing list