User: Password:
|
|
Subscribe / Log in / New account

Who is the best inliner of all?

Who is the best inliner of all?

Posted Jan 16, 2009 21:02 UTC (Fri) by kpfleming (subscriber, #23250)
In reply to: Who is the best inliner of all? by giraffedata
Parent article: Who is the best inliner of all?

Sorry, I was unclear there: I should have said that the only functions *except those in the same source file*.

Regarding -combine, essentially what happens is that each source file is run through cpp separately, then the results are concatenated and fed to the compiler. This avoids preprocessor-level conflicts.

However, keep in mind that -combine alone, while it does provide some benefit, doesn't accomplish most of the desired result. -fwhole-program does that, because when there are multiple source modules, most of the functions will *not* be 'static', as they are cross-module references, and this can interfere with optimization and (especially) inlining. -fwhole-program overrides this, and forces everything to be 'static' scope except those items that are marked with the 'externally_visible' attribute. To gain the most benefits, you need to use both.


(Log in to post comments)


Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds