tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Bloat



On Fri, Jan 30, 2009 at 05:10:30PM +0100, Ignatios Souvatzis wrote:
> 
> For really tiny inlines where the compiler can make use of overall
> optimizations within the caller, this might be different.

Well, this is the thing about eliminating _all_ uses of inline instead
of eliminating _inappropriate_ uses of inline.

If you use an inline as a "better macro" for, say, grabbing member X
from struct Y, the structure member access is always where GCC's
optimizer can see it.  Given the great weakness of gcc's interprocedural
optimization in general (and the cost of doing interprocedural analysis for
the cross-product of the entire set of procedures in the system even
with a _good_ IPA implentation) sometimes you really do want to leave
this sort of thing where the optimizer can see it -- or it will miss
seemingly obvious opportunities to optimize code in places where it does
matter.

I still think "keep it to 5 lines, but do use inline instead of a macro
wherever possible" is a decent rule of thumb.

-- 
Thor Lancelot Simon                                        
tls%rek.tjls.com@localhost
    "Even experienced UNIX users occasionally enter rm *.* at the UNIX
     prompt only to realize too late that they have removed the wrong
     segment of the directory structure." - Microsoft WSS whitepaper


Home | Main Index | Thread Index | Old Index