This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: [cygnus.project.sid] branch probability hinting
- To: "Boehm, Hans" <hans_boehm at hp dot com>
- Subject: Re: [cygnus.project.sid] branch probability hinting
- From: Tom Tromey <tromey at redhat dot com>
- Date: 05 Mar 2001 17:08:28 -0700
- Cc: "'Andrew Haley'" <aph at redhat dot com>, Java Discuss List <java at gcc dot gnu dot org>
- References: <140D21516EC2D3119EE7009027876644049B5C4E@hplex1.hpl.hp.com>
- Reply-To: tromey at redhat dot com
>> Also please everyone note that the compiler already knows that
>> if (p == NULL)
>> is unlikely
Hans> Presumably it will take a hint that it's likely, e.g. when
Hans> scanning a sparse chained hash table?
I don't know.
Hans> How do you tell gcc that the branch probability is around 50-50
Hans> if it already believes otherwise? (E.g. half the child pointers
Hans> in a binary tree are NULL.)
I don't think there is a way. Maybe this should be reported as a gcc
bug. Maybe you ought to be able to tell __builtin_expect the
probability that the branch is taken.
Tom