How to detect whether we're inside of a loop??

Steven Bosscher s.bosscher@student.tudelft.nl
Wed Apr 9 21:10:00 GMT 2003


Op wo 09-04-2003, om 21:39 schreef Jan Hubicka:
> > > We already do have branch prediction algorithm at RTL level.  I
> > > would like to port it to tree-ssa as soon as we realize how to
> > > maintain the profile over RTL expansion....
> > 
> > Yes that would be nice.  Already when I first posted the pointer to the
> > SSA-VRP paper to Diego, it was discussed that we should figure out a way to
> 
> How expansive the SSA-VRP is?  All ways of doing VRP seems to be very
> expensive and/or dificult and the value of having accurate VRP
> information is not too well understood (at least by me), so I am not
> sure it is wortwhile to do in the production compiler.  On the other
> hand it is so cool toy so I would like to see it happen in any case
> and I guess we will find use for it later.

SSA-VRP is basically an extension to SSA constant propagation, so it
should be linear in time.  There is a link to the paper describing the
algorithm from the tree-ssa project page.
It's always possible to only enable it at some high optimization level
if it turns out that it is not very useful and too slow for a production
compiler.

> Note that VRP does not completely replace the existing branch prediction
> algorithm.  Only when combined together it leads to beter prediction.

Yup.  The existing algorithm is based on heuristics, right?  VRP
actually computes branch probabilities.

> There are other showstoppers waiting - we need to replace all the passes
> destroying CFG first - loop optimizer, sibcall, EH expansion.
> We are working on that.

Cool.

Greetz
Steven




More information about the Gcc mailing list