Static branch frequency and program profile analysis

Program profiles identify frequently executed portions of a program, which are the places at which optimizations offer programmers and compilers the greatest benefit. Compilers, however, infrequently exploit program profiles, because profiling a program requires a programmer to instrument and run the program. An attractive alternative is for the compiler to statically estimate program profiles. This paper presents several new techniques for static branch prediction and profiling. The first technique combines multiple predictions of a branch's outcome into a prediction of the probability that the branch is taken. Another technique uses these predictions to estimate the relative execution frequency (i.e., profile) of basic blocks and control-flow edges within a procedure. A third algorithm uses local frequency estimates to predict the global frequency of calls, procedure invocations, and basic block and control-flow edge executions. Experiments on the SPEC92 integer benchmarks and Unix applications show that the frequently executed blocks, edges, and functions identified by our techniques closely match those in a dynamic profile.

[1]  Susan L. Graham,et al.  An execution profiler for modular programs , 1983, Softw. Pract. Exp..

[2]  Youfeng Wu,et al.  Ordering Functions For Improving Memory Reference Locality In A Shared Memory Multiprocessor System , 1992, [1992] Proceedings the 25th Annual International Symposium on Microarchitecture MICRO 25.

[3]  Ira R. Forman,et al.  On the time overhead of counters and traversal markers , 1981, ICSE '81.

[4]  C. V. Ramamoorthy,et al.  Analysis of computational systems: Discrete Markov analysis of computer programs , 1965, ACM '65.

[5]  Scott A. Mahlke,et al.  Using Profile Information to Assist Advaced Compiler Optimization and Scheduling , 1992, LCPC.

[6]  Joseph A. Fisher,et al.  Predicting conditional branch directions from previous runs of a program , 1992, ASPLOS V.

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

[8]  David W. Wall,et al.  Predicting program behavior using real or estimated profiles , 2004, SIGP.

[9]  David W. Wall Predicting program behavior using real or estimated profiles , 1991, PLDI '91.

[10]  S. McFarling Program optimization for instruction caches , 1989, ASPLOS 1989.

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

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

[13]  W. W. Hwu,et al.  Achieving high instruction cache performance with an optimizing compiler , 1989, ISCA '89.

[14]  Youfeng Wu Ordering functions for improving memory reference locality in a shared memory multiprocessor system , 1992, MICRO 1992.

[15]  James R. Larus,et al.  Optimally profiling and tracing programs , 1992, POPL '92.

[16]  Glenn Shafer,et al.  A Mathematical Theory of Evidence , 2020, A Mathematical Theory of Evidence.

[17]  Vivek Sarkar,et al.  Determining average program execution times and their variance , 1989, PLDI '89.

[18]  James R. Larus,et al.  Using the run-time sizes of data structures to guide parallel-thread creation , 1994, LFP '94.

[19]  Joseph A. Fisher,et al.  Trace Scheduling: A Technique for Global Microcode Compaction , 1981, IEEE Transactions on Computers.

[20]  James R. Larus,et al.  Optimally Profiling and Tracing , 1994 .

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

[22]  Jacques Cohen,et al.  Automating program analysis , 1988, JACM.

[23]  Scott A. Mahlke,et al.  Superblock formation using static program analysis , 1993, MICRO.

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

[25]  Scott McFarling,et al.  Program optimization for instruction caches , 1989, ASPLOS III.

[26]  Ken Kennedy,et al.  Efficient call graph analysis , 1992, LOPL.