Partial Redundancy Elimination in Two Iterative Data Flow Analyses

Authors Reshma Roy , Sreekala S , Vineeth Paleri



PDF
Thumbnail PDF

File

LIPIcs.ECOOP.2024.35.pdf
  • Filesize: 0.87 MB
  • 19 pages

Document Identifiers

Author Details

Reshma Roy
  • National Institute of Technology, Calicut, India
Sreekala S
  • National Institute of Technology Calicut, India
Vineeth Paleri
  • National Institute of Technology Calicut, India

Cite AsGet BibTex

Reshma Roy, Sreekala S, and Vineeth Paleri. Partial Redundancy Elimination in Two Iterative Data Flow Analyses. In 38th European Conference on Object-Oriented Programming (ECOOP 2024). Leibniz International Proceedings in Informatics (LIPIcs), Volume 313, pp. 35:1-35:19, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2024)
https://doi.org/10.4230/LIPIcs.ECOOP.2024.35

Abstract

Partial Redundancy Elimination (PRE) is a powerful and well-known code optimization. The idea to combine Common Subexpression Elimination and Loop Invariant Code Motion optimizations into a single optimization was originally conceived by Morel and Renvoise. Their algorithm is bidirectional in nature and was not complete and optimal. Later, Knoop et al. proposed the first complete and optimal algorithm, Lazy Code Motion (LCM), which takes four unidirectional data flow analyses. In a recent paper, Roy et al. proposed an algorithm for PRE that uses three iterative data flow analyses. Here, we propose an efficient algorithm for PRE, which takes only two iterative data flow analyses followed by two computation passes over the program. The algorithm is both computationally and lifetime optimal. The proposed algorithm computes the information required for performing the transformation in two passes over the program without considering safety. The two iterative data flow analyses are required for making the transformation safe. The use of well-known data flow analyses, i.e., available expressions analysis and anticipated expressions analysis, makes the algorithm simple to understand and easy to prove its correctness. The proposed algorithm is more efficient than the existing algorithms since it takes only two iterative data flow analyses. The efficiency of the proposed algorithm is demonstrated by implementing it in LLVM Compiler Infrastructure and comparing the time taken with other selected best-known algorithms.

Subject Classification

ACM Subject Classification
  • Software and its engineering → Compilers
Keywords
  • Static Analysis
  • Data Flow Analysis
  • Code Optimization
  • Partial Redundancy Elimination

Metrics

  • Access Statistics
  • Total Accesses (updated on a weekly basis)
    0
    PDF Downloads

References

  1. The LLVM Compiler Infrastructure Project. http://llvm.org/. Accessed on 03/07/2021.
  2. LLVM programmer’s manual. https://llvm.org/docs/ProgrammersManual.html. Accessed on 20-08-2021.
  3. The SPEC CPU2006 benchmark suit. https://www.spec.org/cpu2006/, 2006. Accessed on 10-01-2022.
  4. Rastisalv Bodík and Sadun Anik. Path-sensitive value-flow analysis. In Proceedings of the 25th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL '98, pages 237-251, New York, NY, USA, 1998. Association for Computing Machinery. URL: https://doi.org/10.1145/268946.268966.
  5. D. M. Dhamdhere. A fast algorithm for code movement optimisation. ACM SIGPLAN Not., 23(10):172-180, October 1988. URL: https://doi.org/10.1145/51607.51621.
  6. Dhananjay M. Dhamdhere. E_path-PRE: Partial redundancy elimination made easy. ACM SIGPLAN Not., 37(8):53-65, August 2002. URL: https://doi.org/10.1145/596992.597004.
  7. KarlHeinz Drechsler and Manfred P. Stadel. A solution to a problem with Morel and Renvoise’s global optimization by suppression of partial redundancies. ACM Trans. Program. Lang. Syst., 10(4):635-640, October 1988. URL: https://doi.org/10.1145/48022.214509.
  8. Karl-Heinz Drechsler and Manfred P. Stadel. A variation of Knoop, Rüthing, and Steffen’s lazy code motion. ACM SIGPLAN Not., 28(5):29-38, May 1993. URL: https://doi.org/10.1145/152819.152823.
  9. Jens Knoop, Oliver Rüthing, and Bernhard Steffen. Lazy code motion. ACM SIGPLAN Not., 27(7):224-234, July 1992. URL: https://doi.org/10.1145/143103.143136.
  10. Jens Knoop, Oliver Rüthing, and Bernhard Steffen. Optimal code motion: Theory and practice. ACM Trans. Program. Lang. Syst., 16(4):1117-1155, July 1994. URL: https://doi.org/10.1145/183432.183443.
  11. Jens Knoop, Oliver Rüthing, and Bernhard Steffen. Expansion-based removal of semantic partial redundancies. In Stefan Jähnichen, editor, Compiler Construction, pages 91-106, Berlin, Heidelberg, 1999. Springer Berlin Heidelberg. Google Scholar
  12. E. Morel and C. Renvoise. Global optimization by suppression of partial redundancies. Commun. ACM, 22(2):96-103, February 1979. URL: https://doi.org/10.1145/359060.359069.
  13. Rei Odaira and Kei Hiraki. Partial value number redundancy elimination. In Rudolf Eigenmann, Zhiyuan Li, and Samuel P. Midkiff, editors, Languages and Compilers for High Performance Computing, pages 409-423, Berlin, Heidelberg, 2005. Springer Berlin Heidelberg. Google Scholar
  14. Vineeth Kumar Paleri, Y. N. Srikant, and Priti Shankar. A simple algorithm for partial redundancy elimination. ACM SIGPLAN Not., 33(12):35-43, December 1998. URL: https://doi.org/10.1145/307824.307851.
  15. Vineeth Kumar Paleri, Y. N. Srikant, and Priti Shankar. Partial redundancy elimination: a simple, pragmatic, and provably correct algorithm. Sci. Comput. Program., 48(1):1-20, 2003. URL: https://doi.org/10.1016/S0167-6423(02)00083-7.
  16. Reshma Roy and Vineeth Paleri. Lexical-based partial redundancy elimination: An optimal algorithm with improved efficiency. Journal of Computer Languages, 75:101204, 2023. URL: https://doi.org/10.1016/j.cola.2023.101204.
  17. Thomas VanDrunen and Antony L. Hosking. Value-based partial redundancy elimination. In Evelyn Duesterwald, editor, Compiler Construction, pages 167-184, Berlin, Heidelberg, 2004. Springer Berlin Heidelberg. Google Scholar
Questions / Remarks / Feedback
X

Feedback for Dagstuhl Publishing


Thanks for your feedback!

Feedback submitted

Could not send message

Please try again later or send an E-mail