ABSTRACT
This work proposes and evaluates improvements to previously known algorithms for redundancy elimination.
Enhanced Scalar Replacement combines two classic techniques, scalar replacement and hash-based value numbering. The former detects redundant array references within and across loop iterations, while the latter detects a large class of redundancies, but only within a single loop iteration. By integrating the two techniques, ESR detects and eliminates a wider range of expression redundancies across loop iterations.
We also extend hash-based value numbering to perform reassociation. Classic redundancy elimination techniques operate on an intermediate representation of the program in which operand association and order is of fixed shape. This rigidity in code shape may sometimes obscure redundancies. Our optimizer attempts to shape the code by changing associativity, exposing more redundancies. Opportunities for ESR, in particular, are increased with reassociation.
- Randy Allen and Ken Kennedy. Vector register allocation. IEEE Transactions on Computers, 41(10):1290--1317, 1992. Google ScholarDigital Library
- Randy Allen and Ken Kennedy. Optimizing Compilers for Modern Architectures: A Dependence-based Approach. Morgan Kaufmann Publishers Inc., San Francisco, CA, USA, 2002. Google ScholarDigital Library
- Rastislav Bodík and Sadun Anik. Path-sensitive value-flow analysis. In POPL '98: Proceedings of the 25th ACM SIGPLAN-SIGACT symposium on Principles of programming languages, pages 237--251, New York, NY, USA, 1998. ACM Press. Google ScholarDigital Library
- Rastislav Bodik, Rajiv Gupta, and Mary Lou Soffa. Load-reuse analysis: Design and evaluation. In SIGPLAN Conference on Programming Language Design and Implementation, pages 64--76, 1999. Google ScholarDigital Library
- I. Bomze, M. Budinich, P. Pardalos, and M. Pelillo. The maximum clique problem. In D.-Z. Du and P. M. Pardalos, editors, Handbook of Combinatorial Optimization, volume 4. Kluwer Academic Publishers, Boston, MA, 1999.Google Scholar
- Melvin A. Breuer. Generation of optimal code for expressions via factorization. Communications of the ACM, pages 333--340, June 1969. Google ScholarDigital Library
- Preston Briggs and Keith D. Cooper. Effective partial redundancy elimination. In PLDI '94: Proceedings of the ACM SIGPLAN 1994 conference on Programming language design and implementation, pages 159--170, New York, NY, USA, 1994. ACM. Google ScholarDigital Library
- Preston Briggs, Keith D. Cooper, and L. Taylor Simpson. Value numbering. Software -- Practice and Experience, 27(6):701--724, 1997. Google ScholarDigital Library
- David Callahan, Steve Carr, and Ken Kennedy. Improving register allocation for subscripted variables. SIGPLAN Notices, 25(6):53--65, June 1990. Proceedings of the ACM SIGPLAN '90 Conference on Programming Language Design and Implementation. Google ScholarDigital Library
- John Cocke and Jacob T. Schwartz. Programming languages and their compilers: Preliminary notes. Technical report, Courant Institute of Mathematical Sciences, New York University, 1970. Google ScholarDigital Library
- Steven J. Deitz, Bradford L. Chamberlain, and Lawrence Snyder. Eliminating redundancies in sum-of-product array computations. In ICS '01: Proceedings of the 15th international conference on Supercomputing, pages 65--77, New York, NY, USA, 2001. ACM Press. Google ScholarDigital Library
- Andrei P. Ershov. On programming of arithmetic operations. Communications of the ACM, 1(8):3--9, 1958. Google ScholarDigital Library
- Andrei P. Ershov. Programming Programme for the BESM Computer. Pergamon Press, 1959.Google Scholar
- J. Felsenstein, S. Sawyer, and R. Kochin. An efficient method for matching nucleic acid sequences. Nucleic Acids Research, 10(1):133--139, 1982.Google ScholarCross Ref
- Dennis J. Frailey. Expression optimization using unary complement operators. SIGPLAN Notices, 5(7):67--85, July 1970. Google ScholarDigital Library
- Dan Gusfield. Algorithms on Strings, Trees, and Sequences: Computer Science and Computational Biology. Cambridge University Press, January 1997. Google ScholarDigital Library
- Hans Kellerer, Ulrich Pferschy, and David Pisinger. Knapsack Problems. Springer, Berlin, Germany, 2004.Google Scholar
Index Terms
- Redundancy elimination revisited
Recommendations
Redundancy Elimination in Distributed Matrix Computation
SIGMOD '22: Proceedings of the 2022 International Conference on Management of DataAs matrix computation becomes increasingly prevalent in large-scale data analysis, distributed matrix computation solutions have emerged. These solutions support query interfaces of linear algebra expressions, which often contain redundant ...
Exploitation of parallelism to nested loops with dependence cycles
In this paper, we analyze the recurrences from the breakability of the dependence links formed in general multi-statements in a nested loop. The major findings include: (1) A sink variable renaming technique, which can reposition an undesired anti-...
An improved algorithm for loop dead optimization
Loop dead variables are the variables, which are defined in a loop, but not used in that loop. On successive execution of loop, these get different value, however all values (except last value) are not used. Hence in optimized program, the definition of ...
Comments