[cfg-branch] Software Trace Cache

Jan Hubicka jh@suse.cz
Tue Nov 13 15:03:00 GMT 2001


> > +      if (e->probability > max_prob 
> > +	  || (e->probability == max_prob
> > +	      && e->dest->frequency > best_edge->dest->frequency))
> 
> Do you really want highest frequency of the destination block?  Note that the
> frequency may come from another predecesor, so the edge to the block may be
> quite infrequent.  I guess you want highest probability.
Oops, I see, you are choosing highest probability + frequency when
probabilities are equivalent.

Maybe we want to work in reverse - ie imagine block A with two successors - B
and C, both entered with probability 50%.  B has additionally an very
predecessor D.

This algorithm will follow A by B, so D will need branch or duplicating.  If
you work in reverse, it will place C and D will be happy.

This is not as side case for estimated profiles as it sounds.

Honza



More information about the Gcc-patches mailing list