1 / 22

Aliasing and Anti-Aliasing in Branch History Table Prediction Kris Breen EE 710 A2 Nov. 26, 2002

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

ace
Download Presentation

Aliasing and Anti-Aliasing in Branch History Table Prediction Kris Breen EE 710 A2 Nov. 26, 2002

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Aliasing and Anti-Aliasing in Branch History Table Prediction Kris Breen EE 710 A2 Nov. 26, 2002

  2. OUTLINE • Introduction • Theory • Experiment • Results • Conclusions & Future Work Aliasing and Anti-Aliasing in BHT Prediction

  3. OUTLINE • Introduction • Theory • Experiment • Results • Conclusions & Future Work Aliasing and Anti-Aliasing in BHT Prediction

  4. INTRODUCTION • Branch history predictors have advantage of simplicity • Prediction accuracy limited by table size, due to aliasing Aliasing and Anti-Aliasing in BHT Prediction

  5. INTRODUCTION 2n-entry BHT n Hash Function PC of branch Aliasing and Anti-Aliasing in BHT Prediction

  6. INTRODUCTION 2n-entry BHT PC of branch 1 n Hash Function ALIASING PC of branch 2 Aliasing and Anti-Aliasing in BHT Prediction

  7. OUTLINE • Introduction • Theory • Experiment • Results • Conclusions & Future Work Aliasing and Anti-Aliasing in BHT Prediction

  8. THEORY • 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. Aliasing and Anti-Aliasing in BHT Prediction

  9. THEORY • 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 Aliasing and Anti-Aliasing in BHT Prediction

  10. THEORY • 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. Aliasing and Anti-Aliasing in BHT Prediction

  11. OUTLINE • Introduction • Theory • Experiment • Results • Conclusions & Future Work Aliasing and Anti-Aliasing in BHT Prediction

  12. EXPERIMENT • 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 Aliasing and Anti-Aliasing in BHT Prediction

  13. EXPERIMENT • 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. Aliasing and Anti-Aliasing in BHT Prediction

  14. EXPERIMENT • 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. Aliasing and Anti-Aliasing in BHT Prediction

  15. OUTLINE • Introduction • Theory • Experiment • Results • Conclusions & Future Work Aliasing and Anti-Aliasing in BHT Prediction

  16. RESULTS • Sample simulation output (from gcc using a 1024 entry table): • bpred_bimod.lookups 56329774 # total number of bpred lookups • bpred_bimod.dir_hits 49575889 # total number of direction-predicted hits • bpred_bimod.misses 6753885 # total number of misses • bpred_bimod.aliases 3991026 # total number of aliases • bpred_bimod.alias_rate 0.0709 # alias rate (aliases/lookups) • bpred_bimod.alias_misses 2614746 # number of mispredictions due to aliasing Aliasing and Anti-Aliasing in BHT Prediction

  17. RESULTS Aliasing and Anti-Aliasing in BHT Prediction

  18. RESULTS • Miss rate when using aliased BHT entries ranged from 44% to 61%, which supports concept that aliased accesses provide effectively random information Aliasing and Anti-Aliasing in BHT Prediction

  19. OUTLINE • Introduction • Theory • Experiment • Results • Conclusions & Future Work Aliasing and Anti-Aliasing in BHT Prediction

  20. CONCLUSIONS • 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% Aliasing and Anti-Aliasing in BHT Prediction

  21. FUTURE WORK • 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 Aliasing and Anti-Aliasing in BHT Prediction

  22. fin Aliasing and Anti-Aliasing in BHT Prediction

More Related