List Archive: gentoo-portage-dev
Note: Due to technical difficulties, the Archives are currently not up to date.
provides an alternative service for most mailing lists.c.f. bug 424647
On Wednesday 28 September 2005 17:10, Jason Stubbs wrote:
> On Wednesday 28 September 2005 23:42, Bastian Balthazar Bux wrote:
> > with src_profile() responsible to do basically two things:
> > - run the builded app with some fake data
> > - rebuild the source using the gathered profile info.
> > The first step within some ebuilds could be done by src_test, the
> > second is basically a reduced src_compile.
> > any thoughts ?
> Do not guess branch probabilities using a randomized model.
> Sometimes GCC will opt to use a randomized model to guess
> branch probabilities, when none are available from either profiling
> feed- back (-fprofile-arcs) or __builtin_expect. This means that
> differ- ent runs of the compiler on the same program may produce
> different object code.
> In a hard real-time system, people don't want different runs
> of the compiler to produce code that has different behavior; minimizing
> non-determinism is of paramount import. This switch allows users to
> reduce non-determinism, possibly at the expense of inferior
> The default is -fguess-branch-probability at levels -O, -O2,
> -O3, -Os.
> Any "test data" that could be used to automatically profile is
> essentially just a randomized model. So it would seem gcc has it
> inbuilt already.
The difference is that the randomized model used by gcc is not based on
possible input to the program (as that might be very big), but on
possible input to more lowlevel concepts such as functions (or even the
condition statement). As such test data, if reasonably representative of
actual data for the application, would give a rather accurate profile of
the branching probabilities and program paths. The more data the better
Paul de Vrieze