Title: Exploring Branch Prediction
1Exploring Branch Prediction
- Aditya Akella
- Shuchi Chawla
- Jia-Yu Pan
2A Framework for Branch Prediction
3Dividing 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)
4Path vs Pattern
- As expected, path history provides better
correlation
5Predictors
- 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
6Implementation Issues Limited space
- Many branches map to same stream Aliasing
- Mostly a destructive effect
- More aggressive schemes may not be necessarily
better
7gshare
GAs
8Implementation Issues Limited space
- Many branches map to same stream Aliasing
- Mostly a destructive effect
- More aggressive schemes may not be necessarily
better
9Cross-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
10Branch 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!!
11How can one improve prediction of such branches?
Use Data Values!!!!!!!!!!!!
12How 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
13Design Problems (1)
- Large number of data values to store
- Soln store their difference
- Branch Difference Predictor (BDP)
14Design 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
15Search for a good predictor design
- Paper
- A Language for Describing Predictors and its
Application to Automatic Synthesis
16Designing a predictor
- Components of a predictor
- Counters and History
- More?
- Formulate as a search problem
- How?
17Search the design space
- Representation
- Feedback Loop Model Primitives
- Pw,d(IU) gt parse tree
Feedback/ Update (U)
d
Input Index (I)
Prediction (P)
w
18Examples
- 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))
19Genetic Programming
- Process
- Population, Evaluation, Selection and populate
next generation - Operations on parse trees
- Replication, Crossover, Mutation, Encapsulation
20Discussion
- Comparable good prediction accuracy
- Complex but new components
- Rediscover counters and local/global histories
- Predictors for other purposes, e.g. indirect jump
target prediction
21End
22Designing a predictor Backup
- Predictors
- Branch prediction
- Data value prediction
- Indirect jump target prediction
- Components of a predictor
- Counters and History
- More?