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

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

Feb 05, 2016

Download

Documents

Andrea Modesto

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
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 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 BreenEE 710 A2

Nov. 26, 2002

Page 2: Aliasing and Anti-Aliasing in Branch History Table Prediction Kris Breen EE 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

Page 3: Aliasing and Anti-Aliasing in Branch History Table Prediction Kris Breen EE 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

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

• Branch history predictors have advantage of simplicity

• Prediction accuracy limited by table size, due to aliasing

INTRODUCTION

Aliasing and Anti-Aliasing in BHT Prediction

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

INTRODUCTION

Aliasing and Anti-Aliasing in BHT Prediction

2n-entry BHT

HashFunction

n PC of branch

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

INTRODUCTION

Aliasing and Anti-Aliasing in BHT Prediction

2n-entry BHT

HashFunction

n PC of branch

1

PC of branch 2

ALIASING

Page 7: Aliasing and Anti-Aliasing in Branch History Table Prediction Kris Breen EE 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

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

• 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

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

• 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

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

• 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

Page 11: Aliasing and Anti-Aliasing in Branch History Table Prediction Kris Breen EE 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

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

• 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

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

• 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

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

• 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

Page 15: Aliasing and Anti-Aliasing in Branch History Table Prediction Kris Breen EE 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

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

• 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

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

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

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

• 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

Page 19: Aliasing and Anti-Aliasing in Branch History Table Prediction Kris Breen EE 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

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

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%

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

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

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

fin

Aliasing and Anti-Aliasing in BHT Prediction