skip to main content
10.1145/1542476.1542512acmconferencesArticle/Chapter ViewAbstractPublication PagespldiConference Proceedingsconference-collections
research-article

Verified validation of lazy code motion

Published:15 June 2009Publication History

ABSTRACT

Translation validation establishes a posteriori the correctness of a run of a compilation pass or other program transformation. In this paper, we develop an efficient translation validation algorithm for the Lazy Code Motion (LCM) optimization. LCM is an interesting challenge for validation because it is a global optimization that moves code across loops. Consequently, care must be taken not to move computations that may fail before loops that may not terminate. Our validator includes a specific check for anticipability to rule out such incorrect moves. We present a mechanically-checked proof of correctness of the validation algorithm, using the Coq proof assistant. Combining our validator with an unverified implementation of LCM, we obtain a LCM pass that is provably semantics-preserving and was integrated in the CompCert formally verified compiler.

References

  1. Clark W. Barret, Yi Fang, Benjamin Goldberg, Ying Hu, Amir Pnueli, and Lenore Zuck. TVOC: A translation validator for optimizing compilers. In phComputer Aided Verification, 17th Int. Conf., CAV 2005, volume 3576 of Lecture Notes in Computer ScienceLNCS, pages 291---295. Springer, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Yves Bertot and Pierre Castéran. phInteractive Theorem Proving and Program Development --- Coq'Art: The Calculus of Inductive Constructions. EATCS Texts in Theoretical Computer Science. Springer, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Rastislav Bodík, Rajiv Gupta, and Mary Lou Soffa. Complete removal of redundant expressions. In phPLDI'98: Proceedings of the ACM SIGPLAN 1998 conference on Programming language design and implementation, pages 1--14. ACM, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. CoqCoq development team. The Coq proof assistant. Software and documentation available at http://coq.inria.fr/, 1989--2009.Google ScholarGoogle Scholar
  5. Sumit Gulwani and George C. Necula. A polynomial-time algorithm for global value numbering. In phStatic Analysis, 11th Int. Symp., SAS 2004, volume 3148 of Lecture Notes in Computer Science, pages 212--227. Springer, 2004.Google ScholarGoogle Scholar
  6. Yuqiang Huang, Bruce R. Childers, and Mary Lou Soffa. Catching and identifying bugs in register allocation. In phStatic Analysis, 13th Int. Symp., SAS 2006, volume 4134 of Lecture Notes in Computer Science, pages 281--300. Springer, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Aditya Kanade, Amitabha Sanyal, and Uday Khedker. A PVS based framework for validating compiler optimizations. In phSEFM'06: Proceedings of the Fourth IEEE International Conference on Software Engineering and Formal Methods, pages 108--117. IEEE Computer Society, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Gerwin Klein and Tobias Nipkow. A machine-checked model for a Java-like language, virtual machine and compiler. ACM Transactions on Programming Languages and Systems Trans. Prog. Lang. Syst., 28 (4): 619--695, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Jens Knoop, Oliver Rüthing, and Bernhard Steffen. Lazy code motion. In phProgramming Languages Design and Implementation 1992, pages 224--234. ACM Press, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Jens Knoop, Oliver Rüthing, and Bernhard Steffen. Optimal code motion: Theory and practice. ACM Transactions on Programming Languages and Systems, 16 (4): 1117--1155, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Dirk Leinenbach, Wolfgang Paul, and Elena Petrova. Towards the formal verification of a C0 compiler: Code generation and implementation correctness. In phInt. Conf. on Software Engineering and Formal Methods (SEFM 2005), pages 2--11. IEEE Computer Society Press, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Sorin Lerner, Todd Millstein, and Craig Chambers. Automatically proving the correctness of compiler optimizations. In phProgramming Language Design and Implementation 2003, pages 220--231. ACM Press, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Xavier Leroy. A formally verified compiler back-end. arXiv:0902.2137 {cs}. Submitted, July 2008.Google ScholarGoogle Scholar
  14. Xavier Leroy. Formal certification of a compiler back-end, or: programming a compiler with a proof assistant. In 33rd symposium Principles of Programming Languages. Principles of Progr. Lang, pages 42--54. ACM Press, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Xavier Leroy and Sandrine Blazy. Formal verification of a C-like memory model and its uses for verifying program transformations. Journal of Automated Reasoning, 41 (1): 1--31, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Xavier Leroy et al. The CompCert verified compiler. Development available at http://compcert.inria.fr, 2004--2009.Google ScholarGoogle Scholar
  17. Etienne Morel and Claude Renvoise. Global optimization by suppression of partial redundancies. Communication of the ACM, 22 (2): 96--103, 1979. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. George C. Necula. Translation validation for an optimizing compiler. In Programming Language Design and Implementation 2000, pages 83--95. ACM Press, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Amir Pnueli, Ofer Shtrichman, and Michael Siegel. The code validation tool (CVT) -- automatic verification of a compilation process. phInternational Journal on Software Tools for Technology Transfer, 2: 192--201, 1998a.Google ScholarGoogle Scholar
  20. Amir Pnueli, Michael Siegel, and Eli Singerman. Translation validation. In phTools and Algorithms for Construction and Analysis of Systems, TACAS'98, volume 1384 of Lecture Notes in Computer Science, pages 151--166. Springer, 1998 Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Martin Rinard and Darko Marinov. Credible compilation with pointers. In phWorkshop on Run-Time Result Verification, 1999.Google ScholarGoogle Scholar
  22. Xavier Rival. Symbolic transfer function-based approaches to certified compilation. In 31st Principles of Programming Languagessymp. Principles of Progr. Lang, pages 1-13. ACM Press, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Bernhard Steffen. Property-oriented expansion. In Static Analysis, Third International Symposium, SAS'96, volume 1145 of Lecture Notes in Computer ScienceLNCS, pages 22--41. Springer, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Jean-Baptiste Tristan and Xavier Leroy. Formal verification of translation validators: A case study on instruction scheduling optimizations. In ph35th symposium Principles of Programming Languages, pages 17--27. ACM Press, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Anna Zaks and Amir Pnueli. Covac: Compiler validation by program analysis of the cross-product. In phFM 2008: Formal Methods, 15th International Symposium on Formal Methods, volume 5014 of Lecture Notes in Computer Science, pages 35--51. Springer, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Lenore Zuck, Amir Pnueli, and Raya Leviathan. Validation of optimizing compilers. Technical Report MCS01-12, Weizmann institute of Science, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Lenore Zuck, Amir Pnueli, Yi Fang, and Benjamin Goldberg. VOC: A methodology for translation validation of optimizing compilers. phJournal of Universal Computer Science, 9 (3): 223--247, 2003.Google ScholarGoogle Scholar

Index Terms

  1. Verified validation of lazy code motion

          Recommendations

          Comments

          Login options

          Check if you have access through your login credentials or your institution to get full access on this article.

          Sign in

          PDF Format

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader
          About Cookies On This Site

          We use cookies to ensure that we give you the best experience on our website.

          Learn more

          Got it!