LWN.net Logo

Who is the best inliner of all?

Who is the best inliner of all?

Posted Jan 15, 2009 12:11 UTC (Thu) by etienne_lorrain@yahoo.fr (guest, #38022)
Parent article: Who is the best inliner of all?

Inlining may also depend on the processor you are compiling for, the more available registers there is, the more efficient it is to inline functions.
Do we want ia64_inline and ia32_inline defines?
Inlining does not only remove call/return costs, but also enable optimisations when arguments are constants, and garanties that some external variable are not modified by the function call - so that there is no need to update the memory before the call, and reload all external variables into registers after the call.
Because most source have been written and optimised for ia32 (few registers), previous optimisations have not been considered to worth the effort.


(Log in to post comments)

Who is the best inliner of all?

Posted Jan 24, 2009 6:40 UTC (Sat) by HalfMoon (guest, #3211) [Link]

Inlining may also depend on the processor you are compiling for, the more available registers there is, the more efficient it is to inline functions.

Also, how good the optimizer is. Even relatively recent versions of GCC seem to have a hard time understanding how, for example, to turn register access functions into single ARM instructions ... unless you hit them over the head with an inline annotation. I've shrunk drivers' I-space footprint from between ten and twenty percent, in some cases, by simple tricks like that.

Contrariwise, sometimes discrete copies of functions are better.

GCC isn't actually known for good inlining, and something that works well on x86 (or, one particular flavor of x86) will sometimes really hurt other processors.

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