Skip to main content

Formal Verification of Optimizing Compilers

  • Conference paper
  • First Online:
Distributed Computing and Internet Technology (ICDCIT 2018)

Part of the book series: Lecture Notes in Computer Science ((LNISA,volume 10722))

Abstract

Formally verifying that a compiler, especially an optimizing one, maintains the semantics of its input has been a challenging problem. This paper surveys several of the main efforts in the area and describes recent efforts that target the LLVM compiler infrastructure while taking a novel viewpoint on the problem.

This work was partially funded by DARPA CSFV project and NSF award CCF-1563393.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    https://gcc.gnu.org/wiki/Speedup_areas.

  2. 2.

    https://github.com/AbsInt/CompCert.

  3. 3.

    https://llvm.org/.

  4. 4.

    https://github.com/Z3Prover/z3/wiki.

References

  1. Coq development team. The Coq proof assistant. https://coq.inria.fr/

  2. Alpern, B., Wegman, M.N., Zadeck, F.K.: Detecting equality of variables in programs. In: POPL 1988, pp. 1–11. ACM, New York (1988)

    Google Scholar 

  3. Barrett, C., Berezin, S.: CVC lite: a new implementation of the cooperating validity checker. In: Alur, R., Peled, D.A. (eds.) CAV 2004. LNCS, vol. 3114, pp. 515–518. Springer, Heidelberg (2004). https://doi.org/10.1007/978-3-540-27813-9_49

    Chapter  Google Scholar 

  4. Barthe, G., Demange, D., Pichardie, D.: Formal verification of an SSA-based middle-end for CompCert. TOPLAS 36(1), 4:1–4:35 (2014)

    Article  Google Scholar 

  5. Dave, M.A.: Compiler verification: a bibliography. SIGSOFT SEN 28(6), 2 (2003)

    Article  Google Scholar 

  6. Fang, Y., Zuck, L.D.: Improved invariant generation for TVOC. ENTCS 176(3), 21–35 (2007)

    Google Scholar 

  7. Floyd, R.: Assigning meanings to programs. Proc. Symp. Appl. Math. 19, 19–32 (1967)

    Article  MathSciNet  MATH  Google Scholar 

  8. Gjomemo, R., Namjoshi, K.S., Phung, P.H., Venkatakrishnan, V.N., Zuck, L.D.: From verification to optimizations. In: DSouza, D., Lal, A., Larsen, K.G. (eds.) VMCAI 2015. LNCS, vol. 8931, pp. 300–317. Springer, Heidelberg (2015). https://doi.org/10.1007/978-3-662-46081-8_17

    Google Scholar 

  9. Goldberg, B., Zuck, L., Barrett, C.: Into the loops: practical issues in translation validation for optimizing compilers. ENTCS 132(1), 53–71 (2005)

    Google Scholar 

  10. Gurfinkel, A., Kahsai, T., Komuravelli, A., Navas, J.A.: The seahorn verification framework. In: CAV, pp. 343–361 (2015)

    Google Scholar 

  11. Hunt Jr., W.A., Kaufmann, M., Moore, J.S., Slobodova, A.: Industrial hardware and software verification with ACL2. Philos. Trans. R. Soc. 375, 40 (2017). (Article Number 20150399)

    Article  Google Scholar 

  12. Le, V., Sun, C., Su, Z.: Randomized stress-testing of link-time optimizers. In: ISSTA, pp. 327–337. ACM(2015)

    Google Scholar 

  13. Leino, K.R.M.: This is boogie 2. Manuscript KRML 178, 131 (2008)

    Google Scholar 

  14. Lerner, S., Millstein, T., Chambers, C.: Automatically proving the correctness of compiler optimizations. ACM SIGPLAN Not. 38(5), 220–231 (2003)

    Article  Google Scholar 

  15. Leroy, X.: Formal verification of a realistic compiler. Commun. ACM 52(7), 107–115 (2009)

    Article  Google Scholar 

  16. Lopes, N.P., Menendez, D., Nagarakatte, S., Regehr, J.: Provably correct peephole optimizations with alive. ACM SIGPLAN Not. 50(6), 22–32 (2015)

    Article  Google Scholar 

  17. McCarthy, J., Painter, J.: Correctness of a compiler for arithmetic expressions. Math. Aspects Comput. Sci. 1, 219–222 (1967)

    MATH  Google Scholar 

  18. Namjoshi, K.S.: Witnessing an SSA transformation. In: VeriSure Workshop and Personal Communication, CAV 2014 (2014). http://ect.bell-labs.com/who/knamjoshi/papers/Namjoshi-VeriSure-CAV-2014.pdf

  19. Namjoshi, K.S., Singhania, N.: Loopy: programmable and formally verified loop transformations. In: Rival, X. (ed.) SAS 2016. LNCS, vol. 9837, pp. 383–402. Springer, Heidelberg (2016). https://doi.org/10.1007/978-3-662-53413-7_19

    Chapter  Google Scholar 

  20. Necula, G.C.: Translation validation for an optimizing compiler. ACM Sigplan Not. 35(5), 83–94 (2000)

    Article  Google Scholar 

  21. Pnueli, A., Siegel, M., Singerman, E.: Translation validation. In: Steffen, B. (ed.) TACAS 1998. LNCS, vol. 1384, pp. 151–166. Springer, Heidelberg (1998). https://doi.org/10.1007/BFb0054170

    Chapter  Google Scholar 

  22. Pnueli, A., Zaks, A.: Translation validation of interprocedural optimizations. In: International Workshop on Software Verification and Validation (2006)

    Google Scholar 

  23. Rakamarić, Z., Emmi, M.: SMACK: decoupling source language details from verifier implementations. In: Biere, A., Bloem, R. (eds.) CAV 2014. LNCS, vol. 8559, pp. 106–113. Springer, Cham (2014). https://doi.org/10.1007/978-3-319-08867-9_7

    Google Scholar 

  24. Samet, H.: Automatically proving the correctness of translations involving optimized code. PhD thesis, Stanford University (1975)

    Google Scholar 

  25. Schmidt, D.A.: Data flow analysis is model checking of abstract interpretations. In: POPL (1998), pp. 38–48. ACM (1998)

    Google Scholar 

  26. Yang, X., Chen, Y., Eide, E., Regehr, J.: Finding and understanding bugs in C compilers. ACM SIGPLAN Not. 46(6), 283–294 (2011)

    Article  Google Scholar 

  27. Zaks, G.: Ensuring correctness of compiled code. Ph.D. thesis, New York University (2009)

    Google Scholar 

  28. Zhao, J., Nagarakatte, S., Martin, M.M.K., Zdancewic, S.: Formalizing the LLVM intermediate representation for verified program transformations. In: ACM SIGPLAN Notices, pp. 427–440. ACM (2012)

    Google Scholar 

  29. Zhao, J., Nagarakatte, S., Martin, M.M.K., Zdancewic, S.: Formal verification of SSA-based optimizations for LLVM. ACM SIGPLAN Not. 48(6), 175–186 (2013)

    Article  Google Scholar 

  30. Zuck, L., Pnueli, A., Goldberg, B., Barrett, C., Fang, Y., Hu, Y.: Translation and run-time validation of loop transformations. FMSD 27(3), 335–360 (2005)

    MATH  Google Scholar 

  31. Zuck, L.D., Pnueli, A., Goldberg, B.: VOC: a methodology for the translation validation of optimizing compilers. J. UCS 9(3), 223–247 (2003)

    Google Scholar 

Download references

Acknowledgements

We thank DARPA and NSF for funding this project. Thanks are also due to our numerous collaborators on this project throughout the years, and especially for Amir Pnueli who introduced Lenore Zuck to the area, as well as Kedar Namjoshi and Venkat Venkatakrishnan who have been close collaborators of hers on the LLVM project.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Lenore D. Zuck .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2018 Springer International Publishing AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Zhang, Y., Zuck, L.D. (2018). Formal Verification of Optimizing Compilers. In: Negi, A., Bhatnagar, R., Parida, L. (eds) Distributed Computing and Internet Technology. ICDCIT 2018. Lecture Notes in Computer Science(), vol 10722. Springer, Cham. https://doi.org/10.1007/978-3-319-72344-0_3

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-72344-0_3

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-72343-3

  • Online ISBN: 978-3-319-72344-0

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics