This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Avoid random block reorderings
- To: law at cygnus dot com
- Subject: Re: Avoid random block reorderings
- From: Geoff Keating <geoffk at cygnus dot com>
- Date: 04 May 2000 15:44:38 -0700
- CC: gcc at gcc dot gnu dot org
- References: <1382.957472836@upchuck>
Jeffrey A Law <law@cygnus.com> writes:
> This patch avoids "random" block reorderings when none of the static branch
> predictors apply by selecting the next physical block (if such a block exists)
> as the predicted successor.
>
> * predict.c (estimate_probability): If no prediction was found, then
> predict the successor that is the next physical block (if such a
> successor exists).
Please don't do this unless you believe it to be true;
> + if (e->flags & EDGE_FALLTHRU)
> + prob = 0;
> + else
> + prob = REG_BR_PROB_BASE;
that is, that when no prediction is found, the branch will almost
always fall through (more than 99.99% of the time).
I don't believe that is true. I would believe 50.1%, but not 99.99%.
Note that on sparc and powerpc and probably others (alpha?) this
information is used for setting the static branch prediction bits,
not just basic block reordering.
--
- Geoffrey Keating <geoffk@cygnus.com>