Inline functions called once III

Dale Johannesen dalej@apple.com
Wed Mar 5 23:27:00 GMT 2003


On Wednesday, March 5, 2003, at 02:58  PM, Joern Rennecke wrote:

> I have found in the past that the impact of inlining a large
> function into a small one on gcc's register allocation is so
> bad that both code compactness and performance suffer
> significantly.

You can certainly construct cases where that's true, as well
as cases where it is not.  For example, when most of the large
function is inside if(formal-parameter) and the corresponding
actual-parameter is 0; this does come up in practice.

A lot of people overgeneralize when they're talking about
inlining heuristics.  In fact, almost anything you can think
of works well in some cases and not so well in others.
Feedback helps a lot; failing that, the best thing is to
provide a lot of knobs to tweak experimentally.



More information about the Gcc-patches mailing list