Control-flow analysis of higher-order languages of taming lambda

Programs written in powerful, higher-order languages like Scheme, ML, and Common Lisp should run as fast as their FORTRAN and C counterparts. They should, but they don't. A major reason is the level of optimisation applied to these two classes of languages. Many FORTRAN and C compilers employ an arsenal of sophisticated global optimisations that depend upon data-flow analysis: common-subexpression elimination, loop-invariant detection, induction-variable elimination, and many, many more. Compilers for higher-order languages do not provide these optimisations. Without them, Scheme, LISP and ML compilers are doomed to produce code that runs slower than their FORTRAN and C counterparts. The problem is the lack of an explicit control-flow graph at compile time, something which traditional data-flow analysis techniques require. In this dissertation, I present a technique for recovering the control-flow graph of a Scheme program at compile time. I give examples of how this information can be used to perform several data-flow analysis optimisations, including copy propagation, induction-variable elimination, useless-variable elimination, and type recovery. The analysis is defined in terms of a non-standard semantic interpretation. The denotational semantics is carefully developed, and several theorems establishing the correctness of the semantics and the implementing algorithms are proven.

[1]  P. J. Landin The Mechanical Evaluation of Expressions , 1964, Comput. J..

[2]  John B. Johnston,et al.  The contour model of block structured processes , 1971, SIGP.

[3]  John C. Reynolds,et al.  Definitional Interpreters for Higher-Order Programming Languages , 1972, ACM '72.

[4]  Matthew Sterling Hecht,et al.  Global data-flow analysis of computer programs. , 1973 .

[5]  Guy L. Steele,et al.  LAMBDA: The Ultimate Declarative , 1976 .

[6]  William H. Harrison,et al.  Compiler Analysis of the Value Ranges for Variables , 1977, IEEE Transactions on Software Engineering.

[7]  Patrick Cousot,et al.  Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints , 1977, POPL.

[8]  Jr. Guy L. Steele,et al.  Rabbit: A Compiler for Scheme , 1978 .

[9]  John C. Reynolds,et al.  Syntactic control of interference , 1978, POPL.

[10]  Patrick Cousot,et al.  Systematic design of program analysis frameworks , 1979, POPL.

[11]  Jeffrey D. Ullman,et al.  A Scheme for the Automatic Inference of Variable Types , 1980, JACM.

[12]  Joseph E. Stoy,et al.  Denotational Semantics: The Scott-Strachey Approach to Programming Language Theory , 1981 .

[13]  John Cocke,et al.  Register Allocation Via Coloring , 1981, Comput. Lang..

[14]  Uwe Frederik Pleban,et al.  Preexecution analysis based on denotational semantics , 1981 .

[15]  Alan Mycroft,et al.  Abstract interpretation and optimising transformations for applicative programs , 1982 .

[16]  Gregory J. Chaitin,et al.  Register allocation & spilling via graph coloring , 1982, SIGPLAN '82.

[17]  Richard C Waters LETS: An Expressional Loop Notation. , 1982 .

[18]  Jonathan Rees,et al.  T: a dialect of Lisp or LAMBDA: The ultimate software tool , 1982, LFP '82.

[19]  John L. Hennessy,et al.  Register allocation by priority-based coloring , 1984, SIGPLAN '84.

[20]  David A. Moon,et al.  Architecture of the Symbolics 3600 , 1985, ISCA '85.

[21]  M. F.,et al.  Bibliography , 1985, Experimental Gerontology.

[22]  James R. Larus,et al.  Design Decisions in SPUR , 1986, Computer.

[23]  Paul Hudak,et al.  Variations on strictness analysis , 1986, LFP '86.

[24]  William D. Clinger,et al.  Revised3 report on the algorithmic language scheme , 1986, SIGP.

[25]  Paul Hudak A semantic model of reference counting and its abstraction (detailed summary) , 1986, LFP '86.

[26]  Paul Hudak,et al.  ORBIT: an optimizing compiler for scheme , 1986, SIGPLAN '86.

[27]  Alfred V. Aho,et al.  Compilers: Principles, Techniques, and Tools , 1986, Addison-Wesley series in computer science / World student series edition.

[28]  John R. Ellis,et al.  Bulldog: A Compiler for VLIW Architectures , 1986 .

[29]  Paul Hudak,et al.  Higher-order strictness analysis in untyped lambda calculus , 1986, POPL '86.

[30]  David A. Schmidt,et al.  Denotationaisemantics: a methodology for language development , 1986 .

[31]  Gerald Jay Sussman,et al.  Abstraction in numerical methods , 1987 .

[32]  Peter D. Mosses,et al.  The use of action semantics , 1986, Formal Description of Programming Concepts.

[33]  Chris Hankin,et al.  Abstract Interpretation of Declarative Languages , 1987 .

[34]  Peter Steenkiste,et al.  Lisp on a reduced-instruction-set processor: characterization and optimization , 1988, Computer.

[35]  David K. Gifford,et al.  Polymorphic effect systems , 1988, POPL '88.

[36]  Richard C. Waters Optimization of Series Expressions: Part I: User''s Manual for the Series Macro Package , 1989 .

[37]  Peter Lee Realistic compiler generation , 1989, Foundations of Computing Series.

[38]  Williams Ludwell Harrison,et al.  The interprocedural analysis and automatic parallelization of Scheme programs , 1990, LISP Symb. Comput..

[39]  Andrew Berlin A Compilation Strategy for Numerical Programs Based on Partial Evaluation , 1989 .

[40]  Andrew W. Appel,et al.  Continuation-passing, closure-passing style , 1989, POPL '89.

[41]  Richard Andrews Kelsey,et al.  Compilation by program transformation , 1989 .

[42]  Robert H. Halstead,et al.  Mul-T: a high-performance parallel Lisp , 1989, PLDI '89.

[43]  Robin Milner,et al.  Definition of standard ML , 1990 .

[44]  Xavier Leroy Efficient Data Representation in Polymorphic Languages , 1990, PLILP.

[45]  Guy E. Blelloch,et al.  Vector Models for Data-Parallel Computing , 1990 .

[46]  Pavel Curtis Constrained qualification in polymorphic type analysis , 1990 .

[47]  Guy E. Blelloch,et al.  Compiling Collection-Oriented Languages onto Massively Parallel Computers , 1990, J. Parallel Distributed Comput..

[48]  Peter Lee,et al.  Metacircularity in the Polymorphic lambda-Calculus , 1991, Theor. Comput. Sci..

[49]  Jon L. White Proceedings of the 1992 ACM conference on LISP and functional programming , 1992 .