skip to main content
10.1145/1140335.1140365acmconferencesArticle/Chapter ViewAbstractPublication PagesppdpConference Proceedingsconference-collections
Article

A type system equivalent to static single assignment

Published:10 July 2006Publication History

ABSTRACT

This paper develops a static type system equivalent to static single assignment (SSA) form. In this type system, a type of a variable at some program point represents the control flows from the assignment statements that reach the program point. For this type system, we show that a derivable typing of a program corresponds to the program in SSA form. By this result, any SSA transformation can be interpreted as a type inference process in our type system. By adopting a result on efficient SSA transformation, we develop a type inference algorithm that reconstructs a type annotated code from a given code. These results provide a static alternative to SSA based compiler optimization without performing code transformation. Since this process does not change the code, it does not incur overhead due to insertion of φ functions. Another advantage of this type based approach is that it is not constrained to naming mechanism of variables and can therefore be combined with other static properties useful for compilation and code optimization such as liveness information of variables. As an application, we express optimizations as type-directed code transformations

References

  1. Bowen Alpern, Mark N. Wegman, and F. Kenneth Zadeck. Detecting equality of variables in programs. In POPL, pages 1--11, 1988.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Andrew W. Appel. SSA is functional programming. ACM SIGPLAN Notices, 33(4):17--20, 1998.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Nick Benton. Simple relational correctness proofs for static analyses and program transformations. In POPL, pages 14--25, 2004.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Gianfranco Bilardi and Keshav Pingali. Algorithms for computing the static single assignment form. J. ACM, 50(3):375--425, 2003.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Preston Briggs, Keith D. Cooper, Timothy J. Harvey, and L. Taylor Simpson. Practical improvements to the construction and destruction of static single assignment form. Software Practice and Experience, 28(8):859--881, 1998.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. M. Chakravarty, P. Keller, and P. Zadarnowski. A functional perspective on SSA optimisation algorithms. Technical Report 0217, University of New South Wales, 2003.]]Google ScholarGoogle Scholar
  7. Jong-Deok Choi, Ron Cytron, and Jeanne Ferrante. Automatic construction of sparse data flow evaluation graphs. In POPL, pages 55--66, 1991.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Keith D. Cooper, L. Taylor Simpson, and Christopher A. Vick. Operator strength reduction. TOPLAS, 23(5):603--625, 2001.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Ron Cytron, Jeanne Ferrante, Barry K. Rosen, Mark N. Wegman, and F. Kenneth Zadeck. Efficiently computing static single assignment form and the control dependence graph. TOPLAS, 13(4):451--490, 1991.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Dibyendu Das and U. Ramakrishna. A practical and fast iterative algorithm for phi-function computation using dj graphs. TOPLAS, 27(3):426--440, 2005.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Richard A. Kelsey. A correspondence between continuation passing style and static single assignment form. ACM SIGPLAN Notices, 30(3):13--22, 1995.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Robert Kennedy, Sun Chan, Shin-Ming Liu, Raymond Lo, Peng Tu, and Fred Chow. Partial redundancy elimination in SSA form. TOPLAS, 21(3):627--676, 1999.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Jens Knoop, Oliver Ruthing, and Bernhard Steffen. Lazy code motion. In PLDI, pages 224--234, 1992.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. David Lacey, Neil Jones, Eric Van Wyk, and Carl Christian Frederikson. Proving correctness of compiler optimizations by temporal logic. Higher-Order and Symbolic Computation, 17(2), 2004.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Sorin Lerner, Todd D. Millstein, and Craig Chambers. Automatically proving the correctness of compiler optimizations. In PLDI, pages 220--231, 2003.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Sorin Lerner, Todd D. Millstein, Erika Rice, and Craig Chambers. Automated soundness proofs for dataflow analyses and transformations via local rules. In POPL, pages 364--377, 2005.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Xavier Leroy. Java bytecode verification: Algorithms and formalizations. J. Autom. Reasoning, 30(3-4):235--269, 2003.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Vijay S. Menon, Neal Glew, Brian R. Murphy, Andrew McCreight, Tatiana Shpeisman, Ali-Reza Adl-Tabatabai, and Leaf Petersen. A verifiable ssa program representation for aggressive compiler optimization. In POPL, pages 397--408, 2006.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Greg Morrisett, David Walker, Karl Crary, and Neal Glew. From System F to typed assembly language. TOPLAS, 21(3):527--568, 1999.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. George Necula. Proof-carrying code. In POPL, pages 106--119, 1997.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Flemming Nielson, Hanne R. Nielson, and Chris Hankin. Principles of Program Analysis. Springer-Verlag New York, Inc., Secaucus, NJ, USA, 1999.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Atsushi Ohori. The logical abstract machine: A curry-howard isomorphism for machine code. In Fuji International Symposium on Functional and Logic Programming, pages 300--318, 1999. (An extended version is available under the title "A Proof Theory for Machine Code" from the author's home page: http://www.pllab.riec.tohoku.ac.jp/~ohori/.)]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Atsushi Ohori. Register allocation by proof transformation. Sci. Comput. Program (also in ESOP'03)., 50(1-3):161--187, 2004.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Barry K. Rosen, Mark N. Wegman, and F. Kenneth Zadeck. Global value numbers and redundant computations. In POPL, pages 12--27, 1988.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Vugranam C. Sreedhar, Roy Dz-Ching Ju, David M. Gillies, and Vatsa Santhanam. Translating out of static single assignment form. In SAS, pages 194--210, 1999.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Raymie Stata and Martín Abadi. A type system for Java bytecode subroutines. In POPL, pages 149--160, 1998.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Michael Weiss. The transitive closure of control dependence: The iterated join. LOPLAS, 1(2):178--190, 1992.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. The SML# Home page. http://www.pllab.riec.tohoku.ac.jp/smlsharp/]]Google ScholarGoogle Scholar

Index Terms

  1. A type system equivalent to static single assignment

            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
            • Published in

              cover image ACM Conferences
              PPDP '06: Proceedings of the 8th ACM SIGPLAN international conference on Principles and practice of declarative programming
              July 2006
              280 pages
              ISBN:1595933883
              DOI:10.1145/1140335
              • General Chair:
              • Annalisa Bossi,
              • Program Chair:
              • Michael Maher

              Copyright © 2006 ACM

              Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

              Publisher

              Association for Computing Machinery

              New York, NY, United States

              Publication History

              • Published: 10 July 2006

              Permissions

              Request permissions about this article.

              Request Permissions

              Check for updates

              Qualifiers

              • Article

              Acceptance Rates

              Overall Acceptance Rate230of486submissions,47%

            PDF Format

            View or Download as a PDF file.

            PDF

            eReader

            View online with eReader.

            eReader