[Ffmpeg-devel] alsa input / output
Dave Dodge
dododge
Tue Mar 27 17:37:58 CEST 2007
On Sun, Mar 25, 2007 at 01:30:43PM -0000, Wolfram Gloger wrote:
> > Michael Niedermayer <michaelni at gmx.at> writes:
> > > the linker would have to disassemble the code ...
> >
> > I didn't say it would be easy, only that the usual standards do not
> > prohibit it.
>
> Not only is it not prohibited, it is considered desirable and
> work is underway to implement it in GCC:
More than that, it's already been implemented for several years in
Intel's C compiler/linker.
My standard anecdote on this: around 2004-2005 I wrote a data
encoding/decoding library with multiple implementations of its
algorithms and the ability to tune some parameters at runtime. For
performance testing I made a timing benchmark where you could set the
tuning values, number of iterations, etc on the command line. When I
compiled the benchmark with icc, every run (even if I specified
billions of iterations) completed instantly. icc had noticed that I
never used the results of all those computations, chased them down
through several functions in several files, figured out that the
functions had no side effects, and basically reduced the entire
program to a no-op. To "fix" it I carefully make sure to feed the
results of every computation into the later iterations, and to use the
final value in a way that generated side effects (e.g. by printing
it).
The way icc did this was to generate .il files alongside the .o files.
In fact I had to add stuff to our Makefile to make sure they got
removed by a "make clean". The .il files contain an "intermediate
language" representation of the code, which is then used at link time
to do cross-file optimizations. Not surprisingly, linking was a
noticably lengthy process.
-Dave Dodge
More information about the ffmpeg-devel
mailing list