[FFmpeg-devel] Disable inlining when using --disable-optimizations

Diego Biurrun diego
Thu Jul 30 23:17:36 CEST 2009


On Thu, Jul 30, 2009 at 10:04:31PM +0100, M?ns Rullg?rd wrote:
> Jeff Downs <heydowns at borg.com> writes:
> 
> > When debugging issues and crashes in ffmpeg recently, I found it helpful 
> > to have a way to disable inlining so you can get real stack frames for 
> > each function. --disable-optimizations gets you most of the way there, but 
> > functions marked av_always_inline will still get inlined.
> >
> > Turns out there is already a case for disabling av_always_inline 
> > (--enable-small); I extended the conditions for that to include 
> > disabled optimizations.
> 
> The blanket disabling of av_always_inline for --enable-small is
> actually wrong.  Many of the functions marked with it are tiny,
> smaller than the function call overhead, meaning they really should
> always be inlined as doing so is both faster and smaller.
> 
> The problem is that av_always_inline is also used on a few fairly
> large functions to ensure that gcc really does inline them, or
> constant propagation will fail, and performance will suffer.
> 
> I'm undecided on how to best deal with these cases under CONFIG_SMALL.
> Not inlining often does give slightly smaller code, at the expense of
> lots of branches or similar.  It could be argued that when the user
> asks for small, that's what he should get.  On the other hand,
> inlining these functions (some of them, at least) makes the code
> faster and only slightly larger.
> 
> Perhaps we need a three classes of inlining:
> 
> - the plain old inline
> - forced inline, unless small
> - forced inline, even when small
> 
> Thoughts appreciated.

Having different macros for different situations available sounds like
the best idea.

Diego



More information about the ffmpeg-devel mailing list