Exploring Branch Prediction - PowerPoint PPT Presentation

About This Presentation
Title:

Exploring Branch Prediction

Description:

As expected, path history provides better correlation. Predictors ... truncate to 1024 streams. truncate to 1024 streams. Implementation Issues: Limited space ... – PowerPoint PPT presentation

Number of Views:38
Avg rating:3.0/5.0
Slides: 22
Provided by: srinivasaa
Learn more at: http://www.cs.cmu.edu
Category:

less

Transcript and Presenter's Notes

Title: Exploring Branch Prediction


1
Exploring Branch Prediction
  • Aditya Akella
  • Shuchi Chawla
  • Jia-Yu Pan

2
A Framework for Branch Prediction
3
Dividing Streams
  • First level per branch substream
  • Finer decomposition
  • Branch pattern history
  • Global pattern history
  • Global path history

1011
1110
(b1,1)(b2,1)(b2,1)
4
Path vs Pattern
  • As expected, path history provides better
    correlation

5
Predictors
  • Static vs Dynamic
  • Adapt to changing bias
  • Damping 2 (or more) bit predictor
  • Is more better?

Static is better on a large number of branches
But, dynamic far outperforms static on the rest
Adaptive schemes should exploit this
6
Implementation Issues Limited space
  • Many branches map to same stream Aliasing
  • Mostly a destructive effect
  • More aggressive schemes may not be necessarily
    better

7
gshare
GAs
8
Implementation Issues Limited space
  • Many branches map to same stream Aliasing
  • Mostly a destructive effect
  • More aggressive schemes may not be necessarily
    better

9
Cross-procedure Correlation
  • Some static prediction schemes forget history
    on returning from a procedure call

Fun_call if (xgt0) return(1) else
return(0) Main a fun_call() if
(agt0) goto
Direction taken by the branch inside the
procedure completely specifies the direction
taken by the branch outside
10
Branch Prediction Using Data Values
  • Traditional approach
  • Local history information
  • Global path and history information
  • Reducing table interference (better indexing)
  • Use PCs and branch outcomes as input
  • Do not contain all the information

Misprediction!!
11
How can one improve prediction of such branches?
Use Data Values!!!!!!!!!!!!
12
How to Use Data Values
  • Speculative branch execution
  • Second scheme was chosen
  • Lower-latency prediction
  • Some branches can use combined predictions
  • Solution avoids data value prediction
  • Using data values directly

13
Design Problems (1)
  • Large number of data values to store
  • Soln store their difference
  • Branch Difference Predictor (BDP)

14
Design Problems (2)
  • Delay in updating data values
  • Out-of-order execution, pipeline latencies
  • REP replacement policy
  • Replace least successful entries
  • Randomly ignore a chunk of mispredictions

15
Search for a good predictor design
  • Paper
  • A Language for Describing Predictors and its
    Application to Automatic Synthesis

16
Designing a predictor
  • Components of a predictor
  • Counters and History
  • More?
  • Formulate as a search problem
  • How?

17
Search the design space
  • Representation
  • Feedback Loop Model Primitives
  • Pw,d(IU) gt parse tree

Feedback/ Update (U)
d
Input Index (I)
Prediction (P)
w
18
Examples
  • Onebitd(PCT)
  • P1,d(PC T)
  • Countern,d(IT)
  • Pn,d(I if T then P1 else P-1)
  • Twobitd(PCT)
  • MSB(Counter2,d(PCT))

19
Genetic Programming
  • Process
  • Population, Evaluation, Selection and populate
    next generation
  • Operations on parse trees
  • Replication, Crossover, Mutation, Encapsulation

20
Discussion
  • Comparable good prediction accuracy
  • Complex but new components
  • Rediscover counters and local/global histories
  • Predictors for other purposes, e.g. indirect jump
    target prediction

21
End
  • Comments?
  • Thank you.

22
Designing a predictor Backup
  • Predictors
  • Branch prediction
  • Data value prediction
  • Indirect jump target prediction
  • Components of a predictor
  • Counters and History
  • More?
Write a Comment
User Comments (0)
About PowerShow.com