This is the mail archive of the 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]
Other format: [Raw text]

Re: [PATCH] Change bb-reorder.c to use succ block frequency

Richard Henderson <> wrote on 06/13/2005 07:46:25 PM:

> On Mon, Jun 13, 2005 at 04:06:29PM -0400, David Edelsohn wrote:
> > >>>>> Richard Henderson writes:
> >
> > Richard> Why?  It seems to me that edge frequency is what's going to
> > Richard> to the cpu when considering the branch.  Particularly forcpus
> > Richard> don't have horrendously sophisticated branch predictors.
> >
> >    From Pat's original message:
> >
> > "Since edge frequency is based off the source block's frequency (src
> > freq * edge prob), this means the code in better_edge_p() which
> > frequencies if edge probabilities are equivalent is useless (if
> > probabilities are equivalent then the edge frequencies will also be
> > equivalent since they're based off the same block frequency)."
> >
> >
> I don't see that that answers the question.  The patch *completely
> the use of edge frequencies with block frequencies.  It doesn't just use
> block frequencies to break ties in edge frequencies.  I see no
> for this change except "the algorithm described in the comments".  Why
> we not instead changing the comments to match the code?
> I've given you a plausible reason for why we might *want* to use edge
> frequencies.  Please refute that in some way.
> When the edge frequencies are identical for conditional branches, I don't
> figure it matters one way or the other which successor we choose.  I also
> expect this isn't the normal case or profiling would be useless.

better_edge_p() first compares edge probabilities to see which is the
better edge, if probabilities are equivalent then it proceeds to the
frequency test. It makes no sense to compare edge frequencies as a
tie-breaker when probabilities are equivalent because edge frequencies are
also going to be equivalent. The algorithm is trying to find the succ block
with the greatest affinity to the current block. The succ block with the
smallest frequency would be that block since the block with the larger
frequency is obtaining that larger frequency from a different predecessor
and therfore possibly has a better affinity to that predecessor.


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