This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: branch predictions
On Thu, May 04, 2000 at 10:46:38PM +0200, Jamie Lokier wrote:
> 1. Annotations. E.g., an attribute on a label to say "unlikely" or
See __builtin_expect in the documentation.
> 2. I wonder if it's plausible to move "very unlikely" code completely
> out of the main line,
Impossible with debugging, and not possible for most architectures
due to branch displacement limitations. We could, I suppose, do
something for x86 and m68k and others that could resonably support
that. With a special compilation flag of course.
> including saved registers etc?
This is called shrink-wrapping. It's on our optimization wish list.
r~