|
ABSTRACT
A lifetime optimal algorithm, called MC-PRE, is presented for the first time that performs speculative PRE based on edge profiles. In addition to being computationally optimal in the sense that the total number of dynamic computations for an expression in the transformed code is minimized, MC-PRE is also lifetime optimal since the lifetimes of introduced temporaries are also minimized. The key in achieving lifetime optimality lies not only in finding a unique minimum cut on a transformed graph of a given CFG, but also in performing a data-flow analysis directly on the CFG to avoid making unnecessary code insertions and deletions. The lifetime optimal results are rigorously proved. We evaluate our algorithm in GCC against three previously published PRE algorithms, namely, MC-PREcopt (Qiong and Xue's computationally optimal version of MC-PRE), LCM (Knoop, Rüthing, and Steffen's lifetime optimal algorithm for performing nonspeculative classic PRE), and CMP-PRE (Bodik, Gupta, and Soffa's PRE algorithm based on code-motion preventing (CMP) regions, which is speculative but not computationally optimal). We report and analyze our experimental results, obtained from both actual program execution and instrumentation, for all 22 C, C++ and FORTRAN 77 benchmarks from SPECcpu2000 on an Itanium 2 computer system. Our results show that MC-PRE (or MC-PREcopt) is capable of eliminating more partial redundancies than both LCM and CMP-PRE (especially in functions with complex control flow), and, in addition, MC-PRE inserts temporaries with shorter lifetimes than MC-PREcopt. Each of both benefits has contributed to the performance improvements in benchmark programs at the costs of only small compile-time and code-size increases in some benchmarks.
REFERENCES
Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.
 |
1
|
B. Alpern , M. N. Wegman , F. K. Zadeck, Detecting equality of variables in programs, Proceedings of the 15th ACM SIGPLAN-SIGACT symposium on Principles of programming languages, p.1-11, January 10-13, 1988, San Diego, California, United States
[doi> 10.1145/73560.73561]
|
| |
2
|
Beszedes, A. 2003. Optimizing for space: Measurements and possibilities for improvement. In GCC Summit 2003.
|
| |
3
|
|
 |
4
|
Rastislav Bodík , Rajiv Gupta , Mary Lou Soffa, Complete removal of redundant expressions, Proceedings of the ACM SIGPLAN 1998 conference on Programming language design and implementation, p.1-14, June 17-19, 1998, Montreal, Quebec, Canada
|
 |
5
|
|
| |
6
|
|
 |
7
|
Pohua P. Chang , Scott A. Mahlke , William Y. Chen , Nancy J. Warter , Wen-mei W. Hwu, IMPACT: an architectural framework for multiple-instruction-issue processors, Proceedings of the 18th annual international symposium on Computer architecture, p.266-275, May 27-30, 1991, Toronto, Ontario, Canada
|
| |
8
|
Chandra S. Chekuri , Andrew V. Goldberg , David R. Karger , Matthew S. Levine , Cliff Stein, Experimental study of minimum cut algorithms, Proceedings of the eighth annual ACM-SIAM symposium on Discrete algorithms, p.324-333, January 05-07, 1997, New Orleans, Louisiana, United States
|
| |
9
|
|
 |
10
|
|
| |
11
|
|
 |
12
|
|
 |
13
|
|
 |
14
|
Dhananjay M. Dhamdhere , Barry K. Rosen , F. Kenneth Zadeck, How to analyze large programs efficiently and informatively, Proceedings of the ACM SIGPLAN 1992 conference on Programming language design and implementation, p.212-223, June 15-19, 1992, San Francisco, California, United States
|
 |
15
|
|
| |
16
|
|
| |
17
|
Ford, L. R. and Fulkerson, D. R. 1962. Flows in Networks. Princeton University Press, Princeton, NJ.
|
| |
18
|
Goldberg, A. 2003. Network Optimization Library. http://www.avglab.com/andrew/soft.html.
|
| |
19
|
|
 |
20
|
|
| |
21
|
|
| |
22
|
|
| |
23
|
Hu, T. C. 1970. Integer Programming and Network Flows. Addison-Wesley, Reading, MA.
|
 |
24
|
|
| |
25
|
Kennedy, K. 1972. Safety of code motion. International Journal of Computer Mathematics 3, 2--3, 117--130.
|
| |
26
|
Robert Kennedy , Fred C. Chow , Peter Dahl , Shin-Ming Liu , Raymond Lo , Mark Streich, Strength Reduction via SSAPRE, Proceedings of the 7th International Conference on Compiler Construction, p.144-158, March 28-April 04, 1998
|
 |
27
|
Robert Kennedy , Sun Chan , Shin-Ming Liu , Raymond Lo , Peng Tu , Fred Chow, Partial redundancy elimination in SSA form, ACM Transactions on Programming Languages and Systems (TOPLAS), v.21 n.3, p.627-676, May 1999
[doi> 10.1145/319301.319348]
|
| |
28
|
|
| |
29
|
|
 |
30
|
Jens Knoop , Oliver Rüthing , Bernhard Steffen, Lazy code motion, Proceedings of the ACM SIGPLAN 1992 conference on Programming language design and implementation, p.224-234, June 15-19, 1992, San Francisco, California, United States
|
 |
31
|
|
| |
32
|
|
 |
33
|
Jin Lin , Tong Chen , Wei-Chung Hsu , Pen-Chung Yew , Roy Dz-Ching Ju , Tin-Fook Ngai , Sun Chan, A compiler framework for speculative analysis and optimizations, Proceedings of the ACM SIGPLAN 2003 conference on Programming language design and implementation, June 09-11, 2003, San Diego, California, USA
|
 |
34
|
|
 |
35
|
|
| |
36
|
|
| |
37
|
|
 |
38
|
B. K. Rosen , M. N. Wegman , F. K. Zadeck, Global value numbers and redundant computations, Proceedings of the 15th ACM SIGPLAN-SIGACT symposium on Principles of programming languages, p.12-27, January 10-13, 1988, San Diego, California, United States
[doi> 10.1145/73560.73562]
|
 |
39
|
Oliver Rüthing , Jens Knoop , Bernhard Steffen, Sparse code motion, Proceedings of the 27th ACM SIGPLAN-SIGACT symposium on Principles of programming languages, p.170-183, January 19-21, 2000, Boston, MA, USA
[doi> 10.1145/325694.325715]
|
 |
40
|
Bernhard Scholz , Nigel Horspool , Jens Knoop, Optimizing for space and time usage with speculative partial redundancy elimination, Proceedings of the 2004 ACM SIGPLAN/SIGBED conference on Languages, compilers, and tools for embedded systems, June 11-13, 2004, Washington, DC, USA
|
| |
41
|
|
| |
42
|
|
| |
43
|
|
| |
44
|
|
| |
45
|
Sverre Jarp. 2002. A methodology for using the Itanium 2 performance counters for bottleneck analysis. http://www.gelato.org/pdf/Performance_counters_final.pdf.
|
 |
46
|
|
CITED BY
|
|
Brian R. Murphy , Vijay Menon , Florian T. Schneider , Tatiana Shpeisman , Ali-Reza Adl-Tabatabai, Fault-safe code motion for type-safe languages, Proceedings of the sixth annual IEEE/ACM international symposium on Code generation and optimization, April 05-09, 2008, Boston, MA, USA
|
|