Skip to main content
Log in

Translation and Run-Time Validation of Loop Transformations

  • Published:
Formal Methods in System Design Aims and scope Submit manuscript

Abstract

This paper presents new approaches to the validation of loop optimizations that compilers use to obtain the highest performance from modern architectures. Rather than verify the compiler, the approach of translation validationperforms a validation check after every run of the compiler, producing a formal proof that the produced target code is a correct implementation of the source code.

As part of an active and ongoing research project on translation validation, we have previously described approaches for validating optimizations that preserve the loop structure of the code and have presented a simulation-based general technique for validating such optimizations. In this paper, for more aggressive optimizations that alter the loop structure of the code—such as distribution, fusion, tiling, and interchange—we present a set of permutation ruleswhich establish that the transformed code satisfies all the implied data dependencies necessary for the validity of the considered transformation. We describe the extensions to our tool voc-64 which are required to validate these structure-modifying optimizations.

This paper also discusses preliminary work on run-time validation of speculative loop optimizations. This involves using run-time tests to ensure the correctness of loop optimizations whose correctness cannot be guaranteed at compile time. Unlike compiler validation, run-time validation must not only determine when an optimization has generated incorrect code, but also recover from the optimization without aborting the program or producing an incorrect result. This technique has been applied to several loop optimizations, including loop interchange and loop tiling, and appears to be quite promising.

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

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. R. Allen and K. Kennedy, Optimizing compilers for modernarchitectures. Morgan Kaufmann, 2002.

  2. J.C. Filliâtre, S. Owre, H. Rueß, and N. Shankar, “ICS: Integrated canonizer and solver,” in Proc. 13rd Intl. Conference on Computer Aided Verification(CAV' 0l), volume 2102 of Lect. Notes in Comp. Sci., Springer-Verlag, 2001.

  3. R.W. Floyd, “Assigning meanings to programs,” Proc. Symposia in Applied Mathematics, Vol. 19, pp. 19–32, 1967.

    MathSciNet  MATH  Google Scholar 

  4. C.C. Frederiksen, “Correctness of Classical Compiler Optimizations using CTL,” in Proc. of Compiler Optimization meets Compiler Verificaiton (COCV) 2002, Electronic Notes in Theoretical Computer Science (ENTCS), Vol. 65, No. 2.

  5. S. Glesner, R. Geiý and B. Boesler, “Verified Code Generation for Embedded Systems,” in Proc. of Compiler Optimization meets Compiler Verificaiton (COCV)2002, Electronic Notes in Theoretical Computer Science (ENTCS), 2002, Vol. 65, No. 2.

  6. B. Goldberg, C. Huneycutt, E. Chapman, and K. Palem, “Software bubbles: Using predicationto compensate for aliasing in software pipelines,” in Proceedings of the International Conference on Parallel Architectures and Compilation Techniques (PACT), 2002.

  7. G. Goos and W. Zimmermann, “Verification of compilers,” in Correct System Design, volume 1710 of Lect. Notes in Comp. Sci., Springer-Verlag, 1999, pp. 201–230.

  8. Z. Manna, A. Anuchitanukul, N. Bjørner, A. Browne, E. Chang, M. Col,ón, L. De Alfaro, H. Devarajan, H. Sipma, and T.E. Uribe, “STe P: The Stanford Temporal Prover,Technical Report STAN-CS-TR-94-1518, Dept. of Comp. Sci., Stanford University, Stanford,California, 1994.

  9. G.C. Necula, “Proof-carrying code,” in POPL'97, 1997, pp. 106–119.

  10. G. Necula, “Translation validation of an optimizing compiler,” in Proceedings of the ACM SIGPLAN Conference on Principles of Programming Languages Design and Implementation (PLDI) 2000, 2000, pp. 83–95.

  11. G.C. Necula and P. Lee, “The design and implementation of a certifyingcompilers,” in Proceedings of the ACM SIGPLAN Conference on Principles of Programming Languages Design and Implementation (PLDI), 1998 pp. 333–344.

  12. A. Pnueli, Y. Rodeh, O. Shtrichman, and M. Siegel, “Deciding equality formulas bysmall-domains instantiations,” in CAV'99, 1999, pp. 455–469.

  13. A. Pnueli, M. Siegel, and O. Shtrichman, “The code validation tool (CVT)-automaticverification of a compilation process,” Software Tools for Technology Transfer, Vol. 2, No. 2, pp. 192–201, 1998.

    Article  MATH  Google Scholar 

  14. A. Pnueli, M. Siegel, and E. Singerman, “Translation validation,” in TACAS'98, 1998, pp. 151–166.

  15. A. Pnueli, L. Zuck, and P. Pandya, “Translation validation of optimizing compilers bycomputational induction,” Technical report, Courant Institute of Mathematical Sciences, New York University, 2000.

  16. M. Rinard and D. Marinov, “Credible compilation with pointers,” in Proceedings ofthe Run-Time Results Verification Workshop, Trento, July 2000.

  17. X. Rival, “Abstract Interpretation-Based Certification of Assembly Code,” in Proc. 4th Intl. Conference on Verification, Model Checking, and Abstract Interpretation (VMCAI'OS), volume 2575 of Lect. Notes in Comp. Sci., Springer-Verlag, 2003, pp. 41–55.

  18. N. Shankar, S. Owre, and J.M. Rushby, “The PVS proof checker: A reference manual (draft),”Technical report, Comp. Sci., Laboratory, SRI International, Menlo Park, CA, 1993.

  19. K.C. Shashidhar, M. Bruynooghe, F. Catthoor, and G. Janssens, “Geometric model checking:An automatic Verification Technique for Loop and Data Reuse Transformations,”in Proc. of Compiler Optimization meets Compiler Verificaiton (COCV) 2002,Electronic Notes in Theoretical Computer Science (ENTCS), 2002, Vol. 65, No. 2.

  20. A. Stump, C. W. Barrett, and D. L. Dill, “CVC: A cooperating validity checker,”in Proc. 14th Intl. Conference on Computer Aided Verification (CAV'02), volume2404 of Lect. Notes in Comp. Sci., Springer- Verlag, 2002, pp. 500–504.

  21. L. Zuck, A. Pnueli, Y. Fang, and B. Goldberg, “VOC: A translation validatorfor optimizing compilers,” Journal of Universal Computer Science, Vol. 9, No. 3, pp. 223–247, 2003.

    Google Scholar 

  22. L. Zuck, A. Pnueli, and R. Leviathan, “Validations of optimizing compliers,” Technical report, Weizmann Institute of Science, 2000.

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Lenore Zuck.

Additional information

This research was supported in part by NSF grant CCR-0098299, ONR grant N00014-99-1-0131, and the John von Neumann Minerva Center for Verification of Reactive Systems.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Zuck, L., Pnueli, A., Goldberg, B. et al. Translation and Run-Time Validation of Loop Transformations. Form Method Syst Des 27, 335–360 (2005). https://doi.org/10.1007/s10703-005-3402-z

Download citation

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10703-005-3402-z

Keywords

Navigation