Accurate static branch prediction by value range propagation
- 1 June 1995
- proceedings article
- Published by Association for Computing Machinery (ACM)
- Vol. 30 (6) , 67-78
- https://doi.org/10.1145/207110.207117
Abstract
The ability to predict at compile time the likelihood of a particular branch being taken provides valuable information for several optimizations, including global instruction scheduling, code layout, function inlining, interprocedural register allocation and many high level optimizations. Previous attempts at static branch prediction have either used simple heuristics, which can be quite inaccurate, or put the burden onto the programmer by using execution profiling data or source code hints.This paper presents a new approach to static branch prediction called value range propagation. This method tracks the weighted value ranges of variables through a program, much like constant propagation. These value ranges may be either numeric of symbolic in nature. Branch prediction is then performed by simply consulting the value range of the appropriate variable. Heuristics are used as a fallback for cases where the value range of the variable cannot be determined statically. In the process, value range propagationsubsumes both constant propagation and copy propagation.Experimental results indicate that this approach produces significantly more accurate predictions than the best existing heuristic techniques. The value range propagation method can be implemented over any “factored” dataflow representation with a static single assignment property (such as SSA form or a dependence flow graph where the variables have been renamed to achieve single assignment). Experimental results indicate that the technique maintains the linear runtime behavior of constant propagation experienced in practice.Keywords
This publication has 27 references indexed in Scilit:
- Branch prediction for freePublished by Association for Computing Machinery (ACM) ,1993
- Interprocedural constant propagationPublished by Association for Computing Machinery (ACM) ,1993
- Dependence-based program analysisPublished by Association for Computing Machinery (ACM) ,1993
- Optimizing array bound checks using flow analysisACM Letters on Programming Languages and Systems, 1993
- Interprocedural constant propagationACM Letters on Programming Languages and Systems, 1993
- Using profile information to assist classic code optimizationsSoftware: Practice and Experience, 1991
- Efficiently computing static single assignment form and the control dependence graphACM Transactions on Programming Languages and Systems, 1991
- Constant propagation with conditional branchesACM Transactions on Programming Languages and Systems, 1991
- A simple interprocedural register allocation algorithm and its effectiveness for LISPACM Transactions on Programming Languages and Systems, 1989
- A unified approach to global program optimizationPublished by Association for Computing Machinery (ACM) ,1973