This is the mail archive of the cgen@sources.redhat.com mailing list for the CGEN project.


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

Re: branch probability hinting


Dave Brolley <brolley@redhat.com> writes:

> 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.

I generally don't buy such arguments.  The casual reader generally
deserves any misunderstandings s/he has.  If it's truly casual
reading, then the misunderstandings are inconsequential.  If someone
really cares to know what's going on, then it's time to become more
circumspect and track down the definition.  This same procedure
applies to zillions of other names in a program that might be
unfamiliar.  LIKELY/UNLIKELY is as evocative of its real meaning for
me as some other choice of names is for you.  As Abe Lincoln once
said: "You can please some of the people all of the time, you can
please all of the people some of the time, but you can't please all of
the people all of the time."

Greg


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