This Article 
   
 Share 
   
 Bibliographic References 
   
 Add to: 
 
Digg
Furl
Spurl
Blink
Simpy
Google
Del.icio.us
Y!MyWeb
 
 Search 
   
Walk-Time Address Adjustment for Improving the Accuracy of Dynamic Branch Prediction
May 1999 (vol. 48 no. 5)
pp. 457-469

Abstract—Dynamic branch prediction has been an effective technique for boosting the performance of modern high performance microprocessors. Since hardware predictors only have a limited number of 2-bit counters but programs often have a large, variable number of branches, two branches in the programs may thus be mapped to the same 2-bit counter. Predictions for these two branches may interfere with each other. This, in turn, reduces the prediction accuracy. In this paper, we discuss how a pre-run-time optimization technique, called address adjustment, can help to reduce branch interference. The technique adjusts the addresses of conditional branches in the given program by inserting NOP instructions at appropriate locations. In this way, the mapping between the conditional branches and the 2-bit counters can be controlled and branch interference can be minimized. Address adjustment can be applied at compile or link time, and the latter makes it a walk-time transformation technique [4]. Three possible address adjustment schemes are investigated: constrained address adjustment, relaxed address adjustment, and branch classification. Experimental results show that address adjustment can reduce branch misprediction ratios on existing hardware predictors. Among the three methods, branch classification has the most improvement.

[1] T. Ball and J.R. Larus, “Branch Prediction for Free,” Proc. ACM SIGPLAN 1993 Conf. Programming Language Design and Implementation, pp. 300-313, June 1993.
[2] P. Chang, E. Hao, T. Yeh, and Y. Patt, “Branch Classification: A New Mechanism for Improving Branch Predictor Performance,” Proc. 27th Ann. ACM/IEEE Int'l Symp. Microarchitecture, Nov. 1994.
[3] J. Fisher and S. Freudenberger,"Predicting Conditional Branch Directions from Previous Runs of a Program," Proc. 5th Int'l Conf. Architectural Support for Programming Languages and Operating Systems (ASPLOS-V), ACM Press, 1992, pp. 85-95.
[4] J.A. Fisher, “Walk-Time Techniques: Catalyst for Architectural Change,” Computer, vol. 30, no. 9, pp. 40-42, Sept. 1997.
[5] N. Gloy, M. Smith, and C. Young, “Performance Issues in Correlated Branch Prediction Schemes,” Proc. 28th Ann. Int'l Symp. Microarchitecture, 1995.
[6] E. Jacobson, E. Rotenberg,, and J.E. Smith,"Assigning Confidence to Conditional Branch Predictions," Proc. 29th Int'l Symp. Microarchitecture, ACM Press, 1996, pp. 142-152.
[7] J.K.F. Lee and A. Smith, “Branch Prediction Strategies and Branch Target Buffer Design,” Computer, vol. 17, no. 1, pp. 6-22, Jan. 1984.
[8] S. Mcfarling, “Combining Branch Predictors,” WRL Technical Note TN-36, Digital Equipment Corp., June 1993.
[9] S. McFarling and J. Hennessy, “Reducing the Cost of Branches,” Proc. 13th Ann. Int'l Symp. Computer Architecture, June 1986.
[10] S. Pan, K. So, and J. Rahmeh, “Improving the Accuracy of Dynamic Branch Prediction Using Branch Correlation,” Proc. Fifth Int'l Conf. Architectural Support for Programming Languages and Operating Systems, pp. 76-84, Oct. 1992.
[11] J.E. Smith, "A Study of Branch Prediction Strategies," Proc. Eighth Ann. Int'l Symp. Computer Architecture, pp. 135-148, June 1981.
[12] SPEC 92, The SPEC Benchmark Report. Fremont, Calif.: Waterside Associates, Jan. 1990.
[13] SPEC95, SPEC Newsletter, Sept. 1995.
[14] A. Srivastava and A. Eustace, "ATOM: A System for Building Customized Program Analysis Tools," Proc. ACM SIGPLAN Conf. Programming Language Design and Implementation, ACM Press, New York, 1994.
[15] A.R. Talcott, M. Nemirovsky, and R.C. Wood, “The Influence of Branch Prediction Table Interference on Branch Prediction Scheme Performance,” Proc. Third Ann. Int'l Conf. Parallel Architectures and Compilation Techniques, June 1995.
[16] T.-Y. Yeh and Y.N. Patt, ``Two-Level Adaptive Branch Prediction,'' Proc. 24th Ann. ACM/IEEE Int'l Symp. Microarchitecture, pp. 51-61, 1991.
[17] T.-Y. Yeh and Y. Patt, “A Comparison of Dynamic Branch Predictors that Use Two Levels of Branch History,” Proc. 20th Ann. Int'l Symp. Computer Architecture, pp. 257-266, May 1993.
[18] T.Y. Yeh and Y.N. Patt, “Two-Level Adaptive Branch Prediction and Instruction Fetch Mechanisms for High Performance Superscalar Processors,” Technical Report CSE-TR-192-93, Computer Science and Eng. Division, Univ. of Michigan, Ann Arbor, Oct. 1993.
[19] C. Young and M. Smith, “Improving the Accuracy of Static Branch Prediction Using Branch Correlation,” Proc. Sixth Int'l Conf. Architectural Support for Programming Languages and Operating Systems, pp. 232-241, Oct. 1994.
[20] C. Young, N. Gloy, and M. Smith, “A Comparative Analysis of Schemes for Correlated Branch Prediction,” Proc. 22nd Ann. Int'l Symp. Computer Architecture, May 1995.

Index Terms:
Branch prediction, address adjustment, computer architecture, compiler optimization, superscalar processor.
Citation:
Chien-Ming Chen, Chung-Ta King, "Walk-Time Address Adjustment for Improving the Accuracy of Dynamic Branch Prediction," IEEE Transactions on Computers, vol. 48, no. 5, pp. 457-469, May 1999, doi:10.1109/12.769430
Usage of this product signifies your acceptance of the Terms of Use.