skip to main content
article

E-path_PRE: partial redundancy elimination made easy

Published: 01 August 2002 Publication History

Abstract

Partial redundancy elimination (PRE) subsumes the classical optimizations of loop invariant movement and common subexpression elimination. The original formulation of PRE involved complex bi-directional data flows and had two major deficiencies---missed optimization opportunities and redundant code movement. To eliminate redundant code movement, most current PRE approaches use a hoisting-followed-by-sinking approach. Unfortunately, this approach has a high conceptual complexity and requires complicated correctness proofs.We show that optimization by partial redundancy elimination is simpler than it has been made out to be. Its essence is the concept of eliminatability of an expression. We show that E-path_PRE, a formulation of PRE based on the concept of eliminatability paths (E-paths), is easy to understand and simple to prove correct. It uses only well-known data flow concepts of available expressions and anticipatable (i.e. very-busy) expressions to directly identify code insertion points which avoid redundant code movement. These features reduce the conceptual complexity of PRE considerably. Interestingly, performance studies show that E-path_PRE is also less expensive to perform than the closest equivalent approach to PRE. This is a sheer bonus.

References

[1]
A. V. Aho, R. Sethi, and J. D. Ullman. Compilers---Principles, Techniques and Tools. Addison Wesley, 1986.]]
[2]
R. Bodik, R. Gupta, and M. L. Soffa. Complete removal of redundant expressions. Proceedings of ACM SIGPLAN '98 Conference on PLDI, pages 1-14, June 1998.]]
[3]
F. Chow et al. A new algorithm for partial redundancy elimination based on SSA form. Proceedings of the SIGPLAN '97 Conference on PLDI, pages 273-286, June 1997.]]
[4]
D. M. Dhamdhere. A fast algorithm for code movement optimization. SIGPLAN Notices, 23(10):172-180, 1988.]]
[5]
D. M. Dhamdhere. Register assignment using code placement techniques. Computer Languages, 13(2):75-93, 1988.]]
[6]
D. M. Dhamdhere. A new algorithm for composite hoisting and strength reduction optimisation. International Journal of Computer Mathematics, 27:1-14, 1989.]]
[7]
D. M. Dhamdhere. A usually linear algorithm for register assignment using edge placement of load and store instructions. Computer Languages, 15(2):83-94, 1990.]]
[8]
D. M. Dhamdhere. Practical adaptation of global optimisation algorithm by morel & renvoise. ACM Transactions on Programming Languages and Systems, 13(2):291-294, 1991.]]
[9]
D. M. Dhamdhere and J. R. Isaac. A composite algorithm for strength reduction and code movement. International Journal of Computers and Information Sciences, pages 243-273, 1980.]]
[10]
D. M. Dhamdhere and U. P. Khedker. Complexity of bidirectional data flows. Proceedings of Twentieth annual symposium on POPL, pages 397-408, 1993.]]
[11]
D. M. Dhamdhere and H. Patil. An elimination algorithm for bi-directional data flow analysis using edge placement technique. ACM TOPLAS, 15(2):312-336, 1993.]]
[12]
D. M. Dhamdhere, B. K. Rosen, and F. K. Zadeck. How to analyze large programs efficiently and informatively. Proceedings of ACM SIGPLAN '92 Conference on PLDI, pages 212-223, 1992.]]
[13]
V. M. Dhaneshwar and D. M. Dhamdhere. Strength reduction of large expressions. Journal of Programming Languages, 3:95-120, 1995.]]
[14]
K. Drechsler and M. P. Stadel. A solution to a problem with morel and renvoise's "global optimization by suppression of partial redundancies". ACM TOPLAS, 10(4):635-640, 1988.]]
[15]
K. Drechsler and M. P. Stadel. A variation of Knoop, Ruthing, and Steffen's lazy code motion. SIGPLAN Notices, 28(5):29-38, 1993.]]
[16]
S. M. Joshi and D. M. Dhamdhere. A composite hoisting-strength reduction transformation for global program optimisation, Parts I and II. International Journal of Computer Mathematics, 11(1 & 2):21-24 & 111-126, 1982.]]
[17]
K. Kennedy. Safety of code movement. International Journal of Computer Mathematics, 3:112-130, 1972.]]
[18]
R. Kennedy et al. Strength Reduction via SSAPRE. LNCS, 1383:144-157, 1998.]]
[19]
U. P. Khedker and D. M. Dhamdhere. A generalised theory of bit vector data flow analysis. ACM TOPLAS, 16(5):1472-1511, September 1994.]]
[20]
U. P. Khedker and D. M. Dhamdhere. Bidirectional data flow analysis: Myths and reality. SIGPLAN Notices, 34(6):47-57, 1999.]]
[21]
J. Knoop, O. Ruthing, and B. Steffen. Lazy code motion. ACM SIGPLAN '92 Conference on PLDI, pages 224-234, June 1992.]]
[22]
J. Knoop, O. Ruthing, and B. Steffen. Optimal code motion: theory and practice. ACM TOPLAS, 30(4):1117-1155, 1994.]]
[23]
J. Knoop, O. Ruthing, and B. Steffen. The power of assignment motion. ACM SIGPLAN '95 Conference on PLDI, 30(5):233-245, 1995.]]
[24]
R. Lo et al. Register promotion by sparse partial redundancy elimination of loads and stores. ACM SIGPLAN '98 Conference on PLDI, pages 26-37, May 1998.]]
[25]
E. Morel and C. Renvoise. Global optimization by suppression of partial rendundancies. Communications of the ACM, 22(2):96-103, February 1979.]]
[26]
S. S. Muchnick. Advanced Compiler Design & Implementation. Morgan Kaufmann, 1997.]]
[27]
V. K. Paleri, Y. N. Srikant, and P. Shankar. A simple algorithm for partial redundancy elimination. Sigplan Notices, 33(12):35-43, 1998.]]
[28]
B. K. Rosen, M. N. Wegman, and F. K. Zadeck. Global value numbers and redundant computations. Proceedings of Fifteenth annual symposium on POPL, pages 12-27, 1988.]]
[29]
O. Ruthing. Bidirectional data flow analysis in code motion: Myth and reality. LNCS, 1503:1-16, 1998.]]
[30]
O. Ruthing, J. Knoop, and B. Steffen. Sparse code motion. Conference record of Principles of Programming Languages, pages 170-183, 2002.]]
[31]
B. Steffen. Property oriented expansion. LNCS, 1145:22-41, 1996.]]
[32]
M. Wolfe. Partial redundancy elimination is not bidirectional. SIGPLAN Notices, 34(6):43-46, 1999.]]

Cited By

View all

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM SIGPLAN Notices
ACM SIGPLAN Notices  Volume 37, Issue 8
August 2002
64 pages
ISSN:0362-1340
EISSN:1558-1160
DOI:10.1145/596992
Issue’s Table of Contents

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 August 2002
Published in SIGPLAN Volume 37, Issue 8

Check for updates

Author Tags

  1. code optimization
  2. data flow analysis
  3. eliminatability of expressions
  4. partial redundancy elimination
  5. redundant code movement

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)11
  • Downloads (Last 6 weeks)0
Reflects downloads up to 30 Jan 2025

Other Metrics

Citations

Cited By

View all

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media