This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Inline functions called once III
> Jan Hubicka <jh at suse dot cz> writes:
>
> > -finline-functions-called-once almost always reduces code size, so it is
> > applicable for -Os and perhaps for -O2 too. It also may be performance
> > loss in the case programer took care to put cold stuff into spearate
> > function, so I tought it may justify special flag.
>
> We could probably address the performance loss by additional
> branch probability heuristics: if there is a function called once, and
> its call site is in a block that is conditionally executed, give that
> block a low probability so it is moved out-of-line.
Yes, partly it can be addressed this way. Other problem is
prologue/epilogue size so we would need shrink wrapping in order to make
inlined function always cheaper.
This does not seem to be serious, as I didn't measured any slowodnws
with this patch in practice.
Honza
>
> zw