Improving static branch prediction in a compiler

An ILP (Instruction-Level Parallelism) compiler uses aggressive optimizations to reduce a program's running time. These optimizations have been shown to be effective when profile information is available. Unfortunately, users are not always willing or able to profile their programs. A method of overcoming this issue is for an ILP compiler to statically infer the information normally obtained from profiling. This paper investigates one aspect of this inference: the static prediction of conditional-branch direction. The goals of this work are to utilize the source-level information available in a compiler when performing static branch prediction, to identify static-branch-prediction cases in which there is a high confidence that a branch will go in one direction at run time, to gain an intuitive understanding into the reasons why the static-branch-prediction heuristics are effective, and ultimately to improve the accuracy of the static branch prediction. The effectiveness of the static-branch-prediction heuristics developed in this paper is demonstrated on a set of programs from SPEC CINT92, SPEC CINT95, and the IMPACT compiler.

[1]  Jason R. C. Patterson,et al.  Accurate static branch prediction by value range propagation , 1995, PLDI '95.

[2]  Alan Jay Smith,et al.  Branch Prediction Strategies and Branch Target Buffer Design , 1995, Computer.

[3]  Wen-mei W. Hwu,et al.  Static Program Analysis to Enhance Profile Independence in Instruction-Level Parallelism Compilation , 1998 .

[4]  Scott A. Mahlke,et al.  Using profile information to assist classic code optimizations , 1991, Softw. Pract. Exp..

[5]  Wen-mei W. Hwu,et al.  IMPACT: an architectural framework for multiple-instruction-issue processors , 1991, [1991] Proceedings. The 18th Annual International Symposium on Computer Architecture.

[6]  Scott A. Mahlke,et al.  Superblock formation using static program analysis , 1993, Proceedings of the 26th Annual International Symposium on Microarchitecture.

[7]  James R. Larus,et al.  Branch prediction for free , 1993, PLDI '93.

[8]  Roger A. Bringmann Enhancing instruction level parallelism through compiler-controlled speculation , 1995 .

[9]  Dirk Grunwald,et al.  Corpus-based static branch prediction , 1995, PLDI '95.

[10]  Michael A. Harrison,et al.  Accurate static estimators for program optimization , 1994, PLDI '94.

[11]  Gang Chen,et al.  GPMB—software pipelining branch-intensive loops , 1993, MICRO 1993.

[12]  Scott Mahlke,et al.  Effective compiler support for predicated execution using the hyperblock , 1992, MICRO 1992.

[13]  Robert B. Murray,et al.  Compiling for the CRISP Microprocessor , 1987, COMPCON.

[14]  James E. Smith,et al.  A study of branch prediction strategies , 1981, ISCA '98.

[15]  Scott A. Mahlke,et al.  Profile‐guided automatic inline expansion for C programs , 1992, Softw. Pract. Exp..