This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Branch prediction
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: Raphael Clifford <raphael at clifford dot net>
- Cc: gcc at gcc dot gnu dot org
- Date: Thu, 30 May 2013 15:45:20 +0200
- Subject: Re: Branch prediction
- References: <CAFHc1Qb0UqZaCwxQFLjmXSu7g+7Qmy1vEkHwBUtfcR-CHaLs5g at mail dot gmail dot com>
> Is there any documentation for what gcc does with branch prediction
> information it gets from profiling? I am interested in this for
> modern Pentium processors where you can no longer give hints.
The profile feedback drives optimizations (i.e. decision what to optimize for
speed and what for size or if it is worth to pesimize one path through program
helping another) and it also affects code layout. Somewhat old writeups are at
http://www.ucw.cz/~hubicka/papers/proj.pdf and
http://gccsummit.org/2005/2005-GCC-Summit-Proceedings.pdf#page=113 These are
still +- accurate to what is happening. Number of optimizations driven by the
profile grew over the years. For example, we now enable aggressive inlining,
vectorization, loop unrolling/peeling and other fancy stuff on parts of program
we know is important by the feedback.
Honza
>
> Specifically I am interested in whether there are in fact any
> optimisations that work reliably from this information.
>
> Raphael