300 likes | 556 Views
Value Prediction. Kyaw Kyaw, Min Pan. Final Project. What is Value Prediction?. Predict the value of instructions before they are executed Branch Prediction – eliminates the control dependences Value Prediction – eliminates the data dependences. Why Value Prediction?.
E N D
Value Prediction Kyaw Kyaw, Min Pan Final Project
What is Value Prediction? • Predict the value of instructions before they are executed • Branch Prediction – eliminates the control dependences • Value Prediction – eliminates the data dependences
Why Value Prediction? • Results of many instructions can be accurately predicted before they are issued or executed. • Dependent instructions are no longer bound by the serialization constraints imposed by data dependences. • More parallelism can be explored
Why Value Prediction is possible? Value Locality
Causes of Value Locality • Data redundancy • Error checking • Program constants • Computed branches …… • Virtual function calls • Glue code • Addressability • Memory alias resolution
Value Prediction Units Three factors determine the efficacy • Accuracy ability to avoid mispredictions • Coverage ability to predict as many instruction outcomes as possible • Scope The set of instructions that the predictor targets
Relationships between factors • Accuracy ↔ Coverage trade-off • Scope • Low implementation cost • Achieve better accuracy and coverage • Mispredictions for useless predictions are eliminated
Value Prediction Units • Three types • History-Based Predictors • Computational Predictors • Hybrid Predictors
Value Prediction Techniques • Last Value Predictor • Register Value Predictor • Stride 2-delta Predictor • Last Four value Predictor • Finite Context Method Predictor • Confidence Estimation
Sample Research Works • “Value Locality and Load Value Prediction” M. H. Lipasti, C. B. Wilkerson, J. P. Shen ASPLOS-VII, October 1996 • “Selective Value Prediction” B. Calder, G. Reinman, D. M. Tullsen Proceedings of 26th International Symposium on Computer Architecture, May 1999
Value Locality & Prediction • Likelihood of a previously-seen value recurring repeatedly within a storage location • Exists primarily due to an effective compile-time optimization
Load Value Prediction • Based on Branch Prediction idea, tries to predict all 32-bit or 64-bit value • Load Value Prediction Table ~ branch target buffer • Load Classification Table ~ branch history table • Constant Verification Unit – to avoid accessing memory and force LVPT entries coherent with main memory
Results • PowerPC 620 = avg. 3% (max 21%) performance gain • Alpha 21164 = avg. 6% (max 17%) performance gain
Selective Value Prediction • Not only on Load instructions but on all important instructions • To speculate on operations with large gains and small losses even when confidence is low, and on operations with small gains and large losses when confidence is high • To intelligently choose – • When to use value prediction • Which instructions to use value prediction
Confidence Prediction • Predicted value is used if the confidence associated with that value is above given threshold. • Confidence Saturating Counter – (low, med, high) • Confidence History Counter – similar to local branch history
Minimizing Capacity Misses • To prevent unnecessary replacement in the value prediction table • Replacement Counter – increment on correct prediction, decrement otherwise • Also decrement when another instruction attempts to use that entry • Warn-up Counter – increment only every time an instruction hits in the value table, set to 0 on a replacement • Only after the warn-up counter has reached a certain threshold, predictions made, confidence counter updated and VPT allowed to be modified
Filtering Producers of Predicted Values • To reduce pressure on the prediction table, predict fewer instructions • Only allow entries to be allocated to instructions that define registers which are actually used by another instruction in the current instruction window • Limit the instructions that are on the critical path to be inserted into VPT
Filtering Producers of Predicted Values • To reduce pressure on the prediction table, predict fewer instructions • Only allow entries to be allocated to instructions that define registers which are actually used by another instruction in the current instruction window • Limit the instructions that are on the critical path to be inserted into VPT
Finding the Important Consumers • Filtering which instructions use a predicted value • Use confidence bits (low, med, high) • Path Heuristic – use predicted values for instructions that have low confidence but are on the longest path