RFA: New optimization: Convert local statics into non-statics

Jeff Law law@redhat.com
Tue Jul 15 00:38:00 GMT 2008


Robert Dewar wrote:
> Diego Novillo wrote:
>> On Mon, Jul 14, 2008 at 08:58, Steven Bosscher <stevenb.gcc@gmail.com> 
>> wrote:
>>
>>>> --- 1,560 ----
>>>> + /* Copyright (C) 2008 Free Software Foundation, Inc.
>>>> +    Contributed by Diego Novillo <dnovillo@redhat.com>
>>> Diego is not at Redhat anymore AFAIK.
>>
>> But I wrote the pass while I was at Red Hat, so I think the
>> attribution is appropriate.
>>
>> Regarding the usefulness of the pass.  It's really not very useful in
>> general, it is a benchmark-specific optimization.  I don't think there
>> is "real" code out there that can benefit from this.  But the pass is
>> very simplistic, so if someone volunteers to maintain it I guess I
>> don't have any problem enabling it with some -f switch.
> 
> I think an entire separate pass that is specifically benchmark oriented
> seems a bad idea, unless there are real world programs, I would forget
> about this optimization, unless it falls out of some more general
> optimization.
> 
> After all, if you really want to get into the business of optimizations
> that are only good for one benchmark, why not go all the way, recognize
> the source of the benchmark, and substitute optimal code?
There's certainly been automated code generators in the past that have 
zealously used statics.  I don't recall if they were file of function 
scoped and I certainly don't know if the usages were optimizable by the 
proposed optimization pass.



More information about the Gcc-patches mailing list