Formal Verification of Optimizing Compilers

Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, 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.

Notes

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.

References

  1. 1.
    Coq development team. The Coq proof assistant. https://coq.inria.fr/
  2. 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. 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 CrossRefGoogle Scholar
  4. 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)CrossRefGoogle Scholar
  5. 5.
    Dave, M.A.: Compiler verification: a bibliography. SIGSOFT SEN 28(6), 2 (2003)CrossRefGoogle Scholar
  6. 6.
    Fang, Y., Zuck, L.D.: Improved invariant generation for TVOC. ENTCS 176(3), 21–35 (2007)Google Scholar
  7. 7.
    Floyd, R.: Assigning meanings to programs. Proc. Symp. Appl. Math. 19, 19–32 (1967)MathSciNetCrossRefMATHGoogle Scholar
  8. 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. 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. 10.
    Gurfinkel, A., Kahsai, T., Komuravelli, A., Navas, J.A.: The seahorn verification framework. In: CAV, pp. 343–361 (2015)Google Scholar
  11. 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)CrossRefGoogle Scholar
  12. 12.
    Le, V., Sun, C., Su, Z.: Randomized stress-testing of link-time optimizers. In: ISSTA, pp. 327–337. ACM(2015)Google Scholar
  13. 13.
    Leino, K.R.M.: This is boogie 2. Manuscript KRML 178, 131 (2008)Google Scholar
  14. 14.
    Lerner, S., Millstein, T., Chambers, C.: Automatically proving the correctness of compiler optimizations. ACM SIGPLAN Not. 38(5), 220–231 (2003)CrossRefGoogle Scholar
  15. 15.
    Leroy, X.: Formal verification of a realistic compiler. Commun. ACM 52(7), 107–115 (2009)CrossRefGoogle Scholar
  16. 16.
    Lopes, N.P., Menendez, D., Nagarakatte, S., Regehr, J.: Provably correct peephole optimizations with alive. ACM SIGPLAN Not. 50(6), 22–32 (2015)CrossRefGoogle Scholar
  17. 17.
    McCarthy, J., Painter, J.: Correctness of a compiler for arithmetic expressions. Math. Aspects Comput. Sci. 1, 219–222 (1967)MATHGoogle Scholar
  18. 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. 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 CrossRefGoogle Scholar
  20. 20.
    Necula, G.C.: Translation validation for an optimizing compiler. ACM Sigplan Not. 35(5), 83–94 (2000)CrossRefGoogle Scholar
  21. 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 CrossRefGoogle Scholar
  22. 22.
    Pnueli, A., Zaks, A.: Translation validation of interprocedural optimizations. In: International Workshop on Software Verification and Validation (2006)Google Scholar
  23. 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. 24.
    Samet, H.: Automatically proving the correctness of translations involving optimized code. PhD thesis, Stanford University (1975)Google Scholar
  25. 25.
    Schmidt, D.A.: Data flow analysis is model checking of abstract interpretations. In: POPL (1998), pp. 38–48. ACM (1998)Google Scholar
  26. 26.
    Yang, X., Chen, Y., Eide, E., Regehr, J.: Finding and understanding bugs in C compilers. ACM SIGPLAN Not. 46(6), 283–294 (2011)CrossRefGoogle Scholar
  27. 27.
    Zaks, G.: Ensuring correctness of compiled code. Ph.D. thesis, New York University (2009)Google Scholar
  28. 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. 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)CrossRefGoogle Scholar
  30. 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)MATHGoogle Scholar
  31. 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

Copyright information

© Springer International Publishing AG 2018

Authors and Affiliations

  1. 1.Department of Computer ScienceUniversity of Illinois at ChicagoChicagoUSA

Personalised recommendations