Who is the best inliner of all?
Posted Jan 24, 2009 6:40 UTC (Sat) by HalfMoon
In reply to: Who is the best inliner of all?
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.
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.
to post comments)