branch probability hinting

Dave Brolley brolley@redhat.com
Thu Mar 1 09:21:00 GMT 2001


Frank Ch. Eigler wrote:

> Hi -
> 
> echristo suggests "expect", which I don't like because
> it doesn't have a natural opposite ("unexpect"?).  mrg
> suggests "predict_true". which I don't like because it's
> too verbose.  I like "LIKELY" because it's short,
> eyecatching, and a reversible adjective/adverb that
> suggests a meta-function rather than an ordinary function.
> 
> I'd like to stick with LIKELY/UNLIKELY for now, until
> a better candidate comes along later, riding alongside
> a champion who is eager enough to do the renaming.
> 
> - FChE

The problem I have with

if (LIKELY (test))
  ...code...

is that to a casual reader it looks like it's an actual test for 
something which is likely (a heuristic?) rather than an optimization hint.

Dave



More information about the Sid mailing list