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: branch predictions





On Thu, 4 May 2000, Jeffrey A Law wrote:

> 
> 
> I can think of three heuristics which would work to resolve this problem.
> 
> 	1. Given two successors, if one unconditionally exits and the
> 	other does not, then predict the path which does not unconditionally
> 	exit.
> 
> 	2. Given two successors, if one passes control to a loop that it
> 	dominates and the other does not, then predict the path to the
> 	dominated loop.
> 
> 	3. If we do not have any kind of prediction and one of the blocks
> 	physically follows the current block, then predict the block which
> 	physically follows the current block.  ie, don't rearrange code
> 	at random ;-)  
> 
> I did a very quick and dirty implementation of #1.  That allowed us to
> properly predict the key branch and we got the desired code.
> 

   this is something that just fell through the cracks. The Ball paper
   discusses heuristics similar to #1,#2. I had on my todo list all of them,
   but never got to it due to reordering itself. Might as well install
   it if you've done the work. Thanks!
   jaosn.

  

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