Re: static estimation of conditional branches?

tom@derby.cs.wisc.edu (Tom Ball)
Wed, 9 Dec 1992 16:36:39 GMT

          From comp.compilers

Related articles
static estimation of conditional branches? mahlke@crhc.uiuc.edu (Scott Mahlke) (1992-12-08)
Re: static estimation of conditional branches? markh@csd4.csd.uwm.edu (1992-12-09)
Re: static estimation of conditional branches? bill@amber.csd.harris.com (1992-12-09)
Re: static estimation of conditional branches? tom@derby.cs.wisc.edu (1992-12-09)
Re: static estimation of conditional branches? tsych@sedona.intel.com (1992-12-09)
Re: static estimation of conditional branches? hagerman@ece.cmu.edu (1992-12-09)
Re: static estimation of conditional branches? bill@amber.csd.harris.com (1992-12-10)
Re: static estimation of conditional branches? hrubin@pop.stat.purdue.edu (1992-12-11)
Re: static estimation of conditional branches? henry@zoo.toronto.edu (1992-12-11)
Re: static estimation of conditional branches? idacrd!desj@uunet.UU.NET (1992-12-12)
[9 later articles]
| List of all articles for this month |

Newsgroups: comp.compilers
From: tom@derby.cs.wisc.edu (Tom Ball)
Organization: University of Wisconsin, Madison -- Computer Sciences Dept.
Date: Wed, 9 Dec 1992 16:36:39 GMT
References: 92-12-029
Keywords: optimize

Scott Mahlke <mahlke@crhc.uiuc.edu> writes:
>I was wondering if anyone is aware of any studies performed to staticly
>estimate the direction of non-loop back conditional branches in C programs.


James Larus and I have nearly completed a paper on statically predicting
branches. We have developed a variety of heuristics for predicting
non-loop branches and measured their effectiveness on a wide variety of
programs. For many programs, most of the dynamic branches are non-loop
branches and it is important to predict these branches accurately to
obtain good overall branch prediction.


Our heuristics are simple, but have quite good performance. As one
example, consider a branch that guards a return. The common case for such
branches is to avoid the return (think of recursion and also error
conditions). In the SPEC benchmark gcc, this heuristic applied to 10% of
the dynamic non-loop branches and correctly predicted 70% of these
branches. In the benchmark xlisp, the heuristic covered 35% of the
branches with 80% correctness. Over the 23 programs we measured this
heuristic had an average of 75% correctness +- 15%.


While it is always possible to defeat a heuristic, programs are usually
written to solve problems rather than to defeat branch prediction
heuristics. Our study shows that programs are often written in such a way
that a set of simple heuristics can be used to effectively predict
non-loop branches. We also use loop analysis to accurately predict
branches that control the iteration of loops. While the accuracy of
program-based prediction cannot approach that of profile-based prediction,
we believe program-based prediction reaches a sufficiently good level to
be of practical use.


We expect to be finished with a full version of the paper in a few weeks,
at which time we will make it available via ftp and post an announcement
here.


-- Tom


Thomas Ball Computer Sciences Dept.
tom@cs.wisc.edu University of Wisconsin-Madison
--


Post a followup to this message

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