Re: Branch prediction hints in an ISA

zs@ender.cs.mu.oz.au (Zoltan Somogyi)
15 Oct 2000 16:27:02 -0400

          From comp.compilers

Related articles
Branch prediction hints in an ISA timgleason@my-deja.com (2000-10-10)
Re: Branch prediction hints in an ISA broeker@physik.rwth-aachen.de (Hans-Bernhard Broeker) (2000-10-12)
Re: Branch prediction hints in an ISA peter_flass@my-deja.com (2000-10-12)
Re: Branch prediction hints in an ISA djimenez@cs.utexas.edu (2000-10-12)
Re: Branch prediction hints in an ISA Kahrs.Juergen@stn-atlas.de (Juergen Kahrs) (2000-10-12)
Re: Branch prediction hints in an ISA erik@arbat.com (Erik Corry) (2000-10-12)
Re: Branch prediction hints in an ISA vbdis@aol.com (2000-10-12)
Re: Branch prediction hints in an ISA zs@ender.cs.mu.oz.au (2000-10-15)
Re: Branch prediction hints in an ISA david.thompson1@worldnet.att.net (David Thompson) (2000-10-18)
Re: Branch prediction hints in an ISA anton@mips.complang.tuwien.ac.at (2000-10-18)
Re: Branch prediction hints in an ISA dietrich@216.26.55.26 (Dietrich Epp) (2000-10-19)
Re: Branch prediction hints in an ISA torbenm@diku.dk (2000-10-19)
| List of all articles for this month |

From: zs@ender.cs.mu.oz.au (Zoltan Somogyi)
Newsgroups: comp.compilers
Date: 15 Oct 2000 16:27:02 -0400
Organization: A poorly-maintained Debian GNU/Linux InterNetNews site
References: 00-10-078 00-10-092
Keywords: architecture

Erik Corry <erik@arbat.com> writes:
>But according to the Alpha optimisation guide, if you know
>which way a branch is likely to go it is almost always worth
>moving the less taken branch to somewhere completely different.
>This reduces the working set. If you move it to the end of
>the function then it will be a forward branch, and so will be
>predicted not taken.


Absolutely; with most modern machines, one wants to minimize the
number of taken branches, whether the branch is predicted or not.


However, there are occasions where you cannot follow this piece of
advice. One such sitation is where a basic block ends with a
conditional branch to its own start; putting a basic block *after*
itself is pretty tough :-) Therefore having a mechanism that tells the
branch predictor that a branch should be predicted to be taken is
still useful.


Zoltan Somogyi <zs@cs.mu.OZ.AU> http://www.cs.mu.oz.au/~zs/
Department of Computer Science and Software Engineering, Univ. of Melbourne


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.