A type system equivalent to static single assignment

  • Authors:
  • Yutaka Matsuno;Atsushi Ohori

  • Affiliations:
  • Tohoku University;Tohoku University

  • Venue:
  • Proceedings of the 8th ACM SIGPLAN international conference on Principles and practice of declarative programming
  • Year:
  • 2006

Quantified Score

Hi-index 0.00

Visualization

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