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



  In message <jmk8haorzd.fsf@envy.cygnus.com>you write:
  > Jeffrey A Law <law@cygnus.com> writes:
  > 
  > > This patch avoids "random" block reorderings when none of the static bran
  > ch
  > > predictors apply by selecting the next physical block (if such a block ex
  > ists)
  > > 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.
I wasn't aware of that.  I'm going to back out my original patch and tweak the
reordering code itself to ignore 50-50 predictions once my bootstrap for
some other changes finishes.

Thanks to you and Richard for setting me straight.

jeff


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