Upload
ace
View
21
Download
0
Tags:
Embed Size (px)
DESCRIPTION
Aliasing and Anti-Aliasing in Branch History Table Prediction Kris Breen EE 710 A2 Nov. 26, 2002. OUTLINE. Introduction Theory Experiment Results Conclusions & Future Work. Aliasing and Anti-Aliasing in BHT Prediction. OUTLINE. Introduction Theory Experiment Results - PowerPoint PPT Presentation
Citation preview
Aliasing and Anti-Aliasing in Branch History Table Prediction
Kris BreenEE 710 A2
Nov. 26, 2002
Aliasing and Anti-Aliasing in BHT Prediction
o Introduction
o Theory
o Experiment
o Results
o Conclusions & Future Work
OUTLINE
Aliasing and Anti-Aliasing in BHT Prediction
o Introduction
o Theory
o Experiment
o Results
o Conclusions & Future Work
OUTLINE
• Branch history predictors have advantage of simplicity
• Prediction accuracy limited by table size, due to aliasing
INTRODUCTION
Aliasing and Anti-Aliasing in BHT Prediction
INTRODUCTION
Aliasing and Anti-Aliasing in BHT Prediction
2n-entry BHT
HashFunction
n PC of branch
INTRODUCTION
Aliasing and Anti-Aliasing in BHT Prediction
2n-entry BHT
HashFunction
n PC of branch
1
PC of branch 2
ALIASING
Aliasing and Anti-Aliasing in BHT Prediction
o Introduction
o Theory
o Experiment
o Results
o Conclusions & Future Work
OUTLINE
• What performance loss occurs due to aliasing?
• Can reasonably assume that aliasing has a negative impact on branch prediction.
• Start by assuming that hash function simply uses low bits of address.
• Analyze static program properties first.
THEORY
Aliasing and Anti-Aliasing in BHT Prediction
• m = total number of addresses in program
size of predictor table
• pb = probability that an instruction is a branch
• p(0 branches hash to x) = (1 - pb)m
• p(2 or more branches hash to x) =
1 - p(0 branches hash to x)- p(1 branch hashes to x)
= 1 - (1 - pb)m - pb(1 - pb)m-1
THEORY
Aliasing and Anti-Aliasing in BHT Prediction
• Assuming 1 in 7 instructions is a branch, and a program size 10 times larger than the table size,
p(2 or more branches hash to x) = 71%
• For a 1024 entry table, this means that about 700 entries are experiencing aliasing. Further evaluation shows that of the remaining 300 entries, about 250 of them likely have no branches hashing to them. These can be used for anti-aliasing.
THEORY
Aliasing and Anti-Aliasing in BHT Prediction
Aliasing and Anti-Aliasing in BHT Prediction
o Introduction
o Theory
o Experiment
o Results
o Conclusions & Future Work
OUTLINE
• Used SimpleScalar to analyze effects of aliasing in programs
• Based experiments on PISA architecture
• Used 2-bit predictor and hash function based on low bits of address
EXPERIMENT
Aliasing and Anti-Aliasing in BHT Prediction
• Modified bpred.[ch] to remember entire branch PC when BHT lookup is done.
• On every BHT lookup, bpred.c compares the current branch PC to the stored branch PC. If these differ, then a lookup alias has occurred, and it is recorded.
• On BHT update, bpred.c checks if the prediction was correct. If it wasn’t, and it was from an aliased table entry, a miss due to aliasing is recorded.
EXPERIMENT
Aliasing and Anti-Aliasing in BHT Prediction
• Simulations were run using Todd Austin’s SPEC2000-derived benchmarks (gcc, anagram, compress, go)
• Branch history table sizes of 32, 256, 1024, and 8192 were each used for each benchmark.
• Percentage of aliased lookups and percentage of misses due to aliasing were recorded for each simulation.
EXPERIMENT
Aliasing and Anti-Aliasing in BHT Prediction
Aliasing and Anti-Aliasing in BHT Prediction
o Introduction
o Theory
o Experiment
o Results
o Conclusions & Future Work
OUTLINE
• Sample simulation output (from gcc using a 1024 entry table):
bpred_bimod.lookups 56329774 # total number of bpred lookupsbpred_bimod.dir_hits 49575889 # total number of direction-predicted hitsbpred_bimod.misses 6753885 # total number of missesbpred_bimod.aliases 3991026 # total number of aliasesbpred_bimod.alias_rate 0.0709 # alias rate (aliases/lookups)bpred_bimod.alias_misses 2614746 # number of mispredictions due to aliasing
RESULTS
Aliasing and Anti-Aliasing in BHT Prediction
RESULTS
Aliasing and Anti-Aliasing in BHT Prediction
Alias Rate vs. Table Size for Four Benchmarks
0
0.05
0.1
0.15
0.2
0.25
0.3
0.35
0.4
0.45
5 7 9 11 13
log2 Table Size
Alias Rate
gcc anagram compress go
• Miss rate when using aliased BHT entries ranged from 44% to 61%, which supports concept that aliased accesses provide effectively random information
RESULTS
Aliasing and Anti-Aliasing in BHT Prediction
Aliasing and Anti-Aliasing in BHT Prediction
o Introduction
o Theory
o Experiment
o Results
o Conclusions & Future Work
OUTLINE
CONCLUSIONS
Aliasing and Anti-Aliasing in BHT Prediction
• Reduction of aliasing can provide a substantial performance gain at minimal cost when using BHT
• Worst case miss rate =
predictor miss rate + alias rate
For a predictor miss rate of 10% and an alias rate of 10%, halving the alias rate improves overall prediction by 25%
FUTURE WORK
Aliasing and Anti-Aliasing in BHT Prediction
• Attempt to reduce loss due to aliasing by passing hash information to processor from program
• Determine program properties (pb, m) for which anti-aliasing will be effective
fin
Aliasing and Anti-Aliasing in BHT Prediction