Affiliation:
1. Rice University, Houston, TX
2. BOPS, Incorporated, Austin, TX
3. Sun Microsystems, Incorporated, Palo Alto, CA
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.
Publisher
Association for Computing Machinery (ACM)
Reference51 articles.
1. Program optimization;ALLEN F. E.;Annual Review in Automatic Programming,1969
2. Multiplication by integer constants
Cited by
38 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Incremental Computation: What Is the Essence? (Invited Contribution);Proceedings of the 2024 ACM SIGPLAN International Workshop on Partial Evaluation and Program Manipulation;2024-01-11
2. Modulo in high-performance code: strength reduction for modulo-based array indexing in loops;The 35th Symposium on Implementation and Application of Functional Languages;2023-08-29
3. From Polynomial Invariants to Linear Loops;Proceedings of the 2023 International Symposium on Symbolic and Algebraic Computation;2023-07-24
4. Algebra-Based Loop Analysis;Proceedings of the 2023 International Symposium on Symbolic and Algebraic Computation;2023-07-24
5. Lazy Code Transformations in a Formally Verified Compiler;Proceedings of the 18th ACM International Workshop on Implementation, Compilation, Optimization of OO Languages, Programs and Systems;2023-07-17