g++ optimizer and numerical computations

Richard Henderson rth@cygnus.com
Mon Feb 16 14:21:00 GMT 1998


On Mon, Feb 16, 1998 at 06:06:01PM +0100, Marc Espie wrote:
> - the refcnt test occurs inside the loop. It has not been moved outside
> the loop by the compiler.

No, gcc is not able to notice test domination of that nature.
Jeff Law played around with that a bit I remember, but I don't
know how succesfulit was.

> - the exceptional case (refcnt != 1) is inside the loop, and the normal
> case (refcnt == 1) is coded as a forward conditional branch, predicted
> to fall through (alpha architecture handbook).  

Only the very very early Alpha's predicted branches in that manner.
The EV4 added a 1 bit history (not terribly effective), and EV5
expanded that to a 2 bit history.  So it's not really as bad as it
seems.


r~



More information about the Gcc mailing list