Вы находитесь на странице: 1из 2

1

Confidence-Based Branch-mispredict Compensation


David Robinson, Jonathan Taylor

I. B RANCH - MISPREDICT C OMPENSATION


Branch prediction is required for efficient resolution of most
modern code. It allows for the processor to effectively determine which instructions are likely to be run next. However,
occasionally the branch-predictor is not correct. In these cases
the processor typically has to roll back the execution timeline
in order to properly account for the fact that it has been doing
work that did not need to be done. At the same time as this
roll-back it has to load the instructions for the correct path and
begin the decode - reorder - rename steps in the pipeline. We
propose that you do the seemingly obvious step of loading
the instructions for the incorrect branch. This should allow
you to then start loading instructions into your execution units
immediately after you determine that your branch predictor
was incorrect.
: Naturally when saying that you should attempt to load
both options at each branch the idea that the branch predictor
is always wrong is an issue. We intend to get around that
by including a method of estimating confidence in the actual
branch prediction. Several papers have been published on the
topic and have even been featured in conferences such as IEEE
High Performance Computer Architecture. These papers detail
methods that allow for the estimation of the accuracy of a
branch prediction that is done at run-time, and adapts to the
information available. Therefore we believe that by using a
confidence-based instruction loading scheme we can somewhat
accurately determine when there is a legitimate concern that
the branch prediction is wrong.
II. W HY B RANCH P REDICTION ?
Currently we have multiple accurate methods of identifying
whether or not a branching decision is likely to be accurate.
This should allow us to figure out the probability that we are
taking the correct path. What we are aiming to accomplish is
the reduction of the penalty of a failure, which has probability
1-confidence, in order to make recovery from a missed branch
prediction easier.
: Additionally when dealing with modern architectures
the branch predictor is very accurate in most situations;
however, certain situations, such as a lot iteration loop, can
result in a low confidence as to whether or not we are taking
the correct branch. Additionally this is influenced by the warmup time of the branch predictor. In the ideal case our system
would be able to account for the low confidence placed upon
the initial warm-up predictions of the branch predictor which
should allow us to compensate for early inaccurate branch
prediction.
: Lastly basing our recovery mechanism off of a calculation of the reliability of our branch prediction should allow
us to be wrong only part of the time. Namely we would only

fetch the theoretically incorrect instructions when we were


attempting to predict an unreliable branch. So if the confidence
is lower than some threshold we should attempt to partition the
instruction buffer such that one portion holds the instructions
that the branch predictor says will be run and the other holds
the other branch paths instructions. Theoretically this should
allow us to abuse a method that compensates for the warm-up
time of a branch predictor while also compensating for lowconfidence branch prediction which occurs in low iteration
loops.
III. T ESTING M ETHODOLOGY
In order to test our idea we will first attempt to implement
the confidence checking and branch partitioning, or separate
fall-through buffer, in either simplescalar or marss86. This
change should be relatively easy to implement in simplescalaroutorder but in marss86 it may prove to be more difficult
as we are both less familiar with it. Additionally the change
should allow us to insert print statements in order to gauge the
accuracy of our threshold so as to fine tune it in order to minimize the number of times it incorrectly gets the other branchs
instructions. After implementing this change we should be able
to see the effects of our new module and branch prediction path
as well as optimize our threshold thereby giving us accurate
performance metrics. Then we should be able to calculate the
different power requirements between the baseline simulation
and the altered simulation in order to determine how much
power the change requires. After collecting this data we should
be able to well whether or not the change is viable in the
modern 1% power to 2% performance age.
IV. T OOLS
The primary tools that we will be using for this will be
the simplescalar processor simulator, primarily the outoforder
variant, as well as Marss86 which is an x86 out of order
simulator that also determines power consumption as well
as many other useful statistics. Simplescalar is available
from http://www.simplescalar.com/ and Marss86 is available
from http://marss86.org/marss86/index.php/Home. As both
are complete x86 processor simulators we will likely be
collecting our data using the SPEC2006 benchmarks which
should give us a good set of information with which to base
our conclusions.

R EFERENCES
[1] E. Jacobsen, E. Rotenberg, and J. E. Smith, Assigning confidence to conditional branch predictions,Proceedings of the 29th Annual IEEE/ACM
International Symposium on Microarchitecture. MICRO 29, Jan. 1996.
[2] S. Manne, A. Klauser, and D. Grunwald, Branch prediction using selective
branch inversion,1999 International Conference on Parallel Architectures
and Compilation Techniques (Cat. No.PR00425), Jan. 1999.
[3] A. Seznec, Storage free confidence estimation for the TAGE branch
predictor,2011 IEEE 17th International Symposium on High Performance
Computer Architecture, Jan. 2011.
[4] K. Malik, M. Agarwal, V. Dhar, and M. Frank, PaCo: Probability-based
path confidence prediction,2008 IEEE 14th International Symposium on
High Performance Computer Architecture, Jan. 2008.

Вам также может понравиться