|
ABSTRACT
Operator strength reduction is a technique that improves compiler-generated code by reformulating certain costly computations in terms of less expensive ones. A common case arises in array addressing expressions used in loops. The compiler can replace the sequence of multiplies generated by a direct translation of the address expression with an equivalent sequence of additions. When combined with linear function test replacement, strength reduction can speed up the execution of loops containing array references. The improvement comes from two sources: a reduction in the number of operations needed to implement the loop and the use of less costly operations.This paper presents a new algorithm for operator strength reduction, called OSR. OSR improves upon an earlier algorithm of Allen, Cocke, and Kennedy [Allen et al. 1981]. OSR operates on the static single assignment (SSA) form of a procedure [Cytron et al. 1991]. By taking advantage of the properties of SSA form, we have derived an algorithm that is simple to understand, quick to implement, and, in practice, fast to run. Its asymptotic complexity is, in the worst case, the same as the Allen, Cocke,and Kennedy algorithm (ACK). OSR achieves optimization results that are equivalent to those obtained with the ACK algorithm. OSR has been implemented in several research and production compilers.
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
|
ALLEN, F. E. 1969. Program optimization. Annual Review in Automatic Programming 5, 239-308.
|
| |
2
|
ALLEN, F. E., COCKE,J.,AND KENNEDY, K. 1981. Reduction of operator strength. In Program Flow Analysis: Theory and Applications, S. S. Muchnick and N. D. Jones, Eds. Prentice-Hall, Englewood Cliffs, NJ, USA.
|
 |
3
|
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]
|
| |
4
|
|
 |
5
|
|
 |
6
|
|
| |
7
|
|
| |
8
|
|
 |
9
|
|
| |
10
|
BRIGGS,P.AND HARVEY, T. J. 1994. Multiplication by integer constants. This is a "web", a literate programming document. See http://softlib.rice.edu/MSCP.
|
 |
11
|
Jiazhen Cai , Robert A. Paige, Look ma, no hashing, and no arrays neither, Proceedings of the 18th ACM SIGPLAN-SIGACT symposium on Principles of programming languages, p.143-154, January 21-23, 1991, Orlando, Florida, United States
[doi> 10.1145/99583.99605]
|
| |
12
|
CHAITIN,G.J.,AUSLANDER, M. A., CHANDRA, A. K., COCKE, J., HOPKINS,M.E.,AND MARKSTEIN,P.W. 1981. Register allocation via coloring. Computer Languages 6, 47-57.
|
| |
13
|
CHASE, D. R. 1988. Personal communication in the form of an unpublished report.
|
 |
14
|
Jong-Deok Choi , Ron Cytron , Jeanne Ferrante, Automatic construction of sparse data flow evaluation graphs, Proceedings of the 18th ACM SIGPLAN-SIGACT symposium on Principles of programming languages, p.55-66, January 21-23, 1991, Orlando, Florida, United States
[doi> 10.1145/99583.99594]
|
 |
15
|
|
 |
16
|
|
| |
17
|
COCKE,J.AND MARKSTEIN, P. 1980a. Measurement of program improvement algorithms. In Proceedings of Information Processing 80. North Holland Publishing Company, Tokyo, Japan.
|
| |
18
|
COCKE,J.AND MARKSTEIN, P. 1980b. Strength reduction for division and modulo with application to a multilevel store. IBM J. Res. Dev. 24, 6, 692-694.
|
| |
19
|
COCKE,J.AND SCHWARTZ, J. T. 1970. Programming languages and their compilers: Preliminary notes. Tech. rep., Courant Institute of Mathematical Sciences, New York University.
|
| |
20
|
COOPER,K.D.AND SIMPSON, L. T. 1995. SCC-based value numbering. Tech. Rep. TR95636, Center for Research on Parallel Computation, Rice University. Oct.
|
 |
21
|
|
| |
22
|
DHAMDHERE, D. M. 1979. On algorithms for operator strength reduction. Communications of the ACM 22, 5 (May), 311-312.
|
| |
23
|
DHAMDHERE, D. M. 1989. A new algorithm for composite hoisting and strength reduction. Int. J. Comput. Math. 27, 1, 1-14.
|
 |
24
|
|
| |
25
|
EARLY, J. 1974. High level iterators and a method of automatically designing data structure representation. Tech. Rep. ERL-M416, Computer Science Division, University of California, Berkeley. Feb.
|
 |
26
|
|
 |
27
|
|
| |
28
|
GRANLUND, T. 1995. Private communication with P. Briggs. Discussion of his work in building the routine synth mult for the Gnu C Compiler.
|
 |
29
|
|
| |
30
|
|
 |
31
|
|
| |
32
|
ISSAC,J.AND DHAMDHERE, D. M. 1980. A composite algorithm for strength reduction and code movement. Int. J. Comput. Info. Sci. 9, 3, 243-273.
|
 |
33
|
|
| |
34
|
KENNEDY, K. 1973. Reduction in strength using hashed temporaries. SETL Newsletter 102, Courant Institute of Mathematical Sciences, New York University. Mar.
|
| |
35
|
KENNEDY, K. 1978. Use-definition chains with applications. Computer Languages 3, 163- 179.
|
 |
36
|
|
| |
37
|
KNOOP, J., RUTHING,O.,AND STEFFEN, B. 1993. Lazy strength reduction. J. Program. Lang. 1,1, 71-91.
|
 |
38
|
|
 |
39
|
|
| |
40
|
|
| |
41
|
MARKSTEIN,P.W.,MARKSTEIN,V.,AND ZADECK, F. K. 1994. Reassociation and strength reduction. Chapter from an unpublished book, Optimization in Compilers.
|
 |
42
|
|
 |
43
|
|
 |
44
|
|
| |
45
|
SANTHANAM, V. 1992. Register reassociation in PA-RISC compilers. Hewlett-Packard Journal 14,6 (June), 33-38.
|
| |
46
|
SCARBOROUGH,R.G.AND KOLSKY, H. G. 1980. Improved optimization of FORTRAN object programs. IBM J. Res. Dev. 24, 6 (Nov.), 660-676.
|
 |
47
|
|
| |
48
|
TARJAN, R. E. 1972. Depth first search and linear graph algorithms. SIAM J. Comput. 1, 2 (June), 146-160.
|
| |
49
|
TARJAN, R. E. 1974. Testing flow graph reducibility. J. Comput. Syst. Sci. 9, 355-365.
|
| |
50
|
VICK, C. A. 1994. SSA based reduction of operator strength. M.S. dissertation, Rice University, Department of Computer Science.
|
 |
51
|
|
 |
52
|
|
 |
53
|
|
CITED BY 5
|
|
L. Almagor , Keith D. Cooper , Alexander Grosul , Timothy J. Harvey , Steven W. Reeves , Devika Subramanian , Linda Torczon , Todd Waterman, Finding effective compilation sequences, ACM SIGPLAN Notices, v.39 n.7, July 2004
|
|
|
Vijay S. Menon , Neal Glew , Brian R. Murphy , Andrew McCreight , Tatiana Shpeisman , Ali-Reza Adl-Tabatabai , Leaf Petersen, A verifiable SSA program representation for aggressive compiler optimization, ACM SIGPLAN Notices, v.41 n.1, p.397-408, January 2006
|
|
|
Keith D. Cooper , Alexander Grosul , Timothy J. Harvey , Steve Reeves , Devika Subramanian , Linda Torczon , Todd Waterman, Exploring the structure of the space of compilation sequences using randomized search algorithms, The Journal of Supercomputing, v.36 n.2, p.135-151, May 2006
|
|
|
|
|
|
|
|