This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Avoid random block reorderings


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>

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]