Design and Implementation of Code Optimizations for a Type-Directed Compiler for Standard ML.

Abstract : The trends in software development are towards larger programs, more complex programs, and more use of programs as 'component software'. These trends mean that the features of modern programming languages are becoming more important than ever before. Programming languages need to have features such as strong typing, a module system, polymorphism, automatic storage management, and higher order functions. In short, modern programming languages are becoming more important than ever before. Even though modern programming languages are becoming more important than ever before, programmers have traditionally faced a dilemma: programs written in these languages traditionally have had lower performance than programs written in more conventional, but error-prone languages. This thesis studies this problem in the context of one particular modern programming language, Standard ML. Standard ML contains all the language features mentioned previously and more. The author uses an empirical approach to understand where Standard ML programs spend their time and how to improve the performance of Standard ML programs though better optimization. The thesis contains two main results. First, it is found that a 'pay-as-you-go' compilation strategy, where programmers pay for advanced language features only when they use them, is a practical strategy for compiling Standard ML. In fact, this strategy produces better code overall than a strategy that makes advanced language features run fast at the expense of slowing down programs that do not use those language features. Second, compilers for Standard ML should focus on generating good code for the frequently-executed parts of programs.

[1]  David A. Patterson,et al.  Computer Architecture: A Quantitative Approach , 1969 .

[2]  Robert Fenichel,et al.  A LISP garbage-collector for virtual-memory computer systems , 1969, CACM.

[3]  Chris J. Cheney A nonrecursive list compacting algorithm , 1970, Commun. ACM.

[4]  Dianne Ellen Britton,et al.  Heap storage management for the programming language Pascal , 1975 .

[5]  Gordon D. Plotkin,et al.  Call-by-Name, Call-by-Value and the lambda-Calculus , 1975, Theor. Comput. Sci..

[6]  Jeffrey M. Barth A practical interprocedural data flow analysis algorithm , 1978, CACM.

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

[8]  Barbara G. Ryder,et al.  Constructing the Call Graph of a Program , 1979, IEEE Transactions on Software Engineering.

[9]  William E. Weihl,et al.  Interprocedural data flow analysis in the presence of pointers, procedure variables, and label variables , 1980, POPL '80.

[10]  Henry Lieberman,et al.  A real-time garbage collector based on the lifetimes of objects , 1983, CACM.

[11]  Fred C. Chow,et al.  A portable machine-independent global optimizer--design and measurements , 1984 .

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

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

[14]  David Ungar,et al.  The design and evaluation of a high performance Smalltalk system , 1987 .

[15]  Joannes M. Lucassen Types and Effects Towards the Integration of Functional and Imperative Programming. , 1987 .

[16]  Andrew W. Appel,et al.  Garbage Collection can be Faster than Stack Allocation , 1987, Inf. Process. Lett..

[17]  Pierre Jouvelot,et al.  FX-87 Reference Manual. Edition 1.0. , 1987 .

[18]  Olin Shivers,et al.  Control flow analysis in scheme , 1988, PLDI '88.

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

[20]  David R. Chase,et al.  Safety consideration for storage allocation optimizations , 1988, PLDI '88.

[21]  Mark D. Hill,et al.  A case for direct-mapped caches , 1988, Computer.

[22]  Daniel G. Bobrow,et al.  Combining generational and conservative garbage collection: framework and implementations , 1989, POPL '90.

[23]  STEPHEN RICHARDSON,et al.  Interprocedural optimization: Experimental results , 1989, Softw. Pract. Exp..

[24]  Alan Jay Smith,et al.  Evaluating Associativity in CPU Caches , 1989, IEEE Trans. Computers.

[25]  Andrew W. Appel,et al.  Simple generational garbage collection and fast allocation , 1989, Softw. Pract. Exp..

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

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

[28]  Chih-Jui Peng,et al.  Cache Memory Design Considerations to Support Languages with Dynamic Heap Allocation , 1989 .

[29]  Benjamin G. Zorn,et al.  Comparative performance evaluation of garbage collection algorithms , 1989 .

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

[31]  John H. Reppy,et al.  Asynchronous Signals is Standard ML , 1990 .

[32]  James R. Larus,et al.  Abstract execution: A technique for efficiently tracing programs , 1990, Softw. Pract. Exp..

[33]  Robert Hieb,et al.  Representing control in the presence of first-class continuations , 1990, PLDI '90.

[34]  Andrew W. Appel A runtime system , 1990 .

[35]  Steven A. Przybylski,et al.  Cache and memory hierarchy design: a performance-directed approach , 1990 .

[36]  Pierre Jouvelot,et al.  Polymorphic type, region and effect inference , 1992, Journal of Functional Programming.

[37]  Andrew W. Appel,et al.  Compiling with Continuations , 1991 .

[38]  Benjamin G. Zorn The Effect of Garbage Collection on Cache Performance , 1991 .

[39]  Olin Shivers,et al.  Control-flow analysis of higher-order languages of taming lambda , 1991 .

[40]  Lawrence C. Paulson,et al.  ML for the working programmer , 1991 .

[41]  Richard E. Kessler,et al.  Page placement algorithms for large real-indexed caches , 1992, TOCS.

[42]  Amer Diwan,et al.  Compiler support for garbage collection in a statically typed language , 1992, PLDI '92.

[43]  Paul R. Wilson,et al.  Caching considerations for generational garbage collection , 1992, LFP '92.

[44]  James R. Larus,et al.  Optimally profiling and tracing programs , 1992, POPL '92.

[45]  Ken Kennedy,et al.  Efficient call graph analysis , 1992, LOPL.

[46]  Xavier Leroy,et al.  Unboxed objects and polymorphic typing , 1992, POPL '92.

[47]  Peter Lee,et al.  Cache behavior of combinator graph reduction , 1992, TOPL.

[48]  Rance Cleaveland,et al.  The concurrency workbench: a semantics-based tool for the verification of concurrent systems , 1993, TOPL.

[49]  Dirk Grunwald,et al.  Improving the cache locality of memory allocation , 1993, PLDI '93.

[50]  Norman P. Jouppi Cache write policies and performance , 1993, ISCA '93.

[51]  Brian N. Bershad,et al.  The impact of operating system structure on memory system performance , 1994, SOSP '93.

[52]  Ian A. Mason,et al.  A Variable Typed Logic of E ects , 1993 .

[53]  Mark Baldwin Reinhold CACHE PERFORMANCE OF GARBAGE-COLLECTED PROGRAMMING LANGUAGES , 1993 .

[54]  M. Felleisen,et al.  Reasoning about programs in continuation-passing style , 1993 .

[55]  Jeffrey D. Ullman Elements of ML programming , 1994 .

[56]  Carolyn L. Talcott,et al.  Program Transformation via Contextual Assertions , 1994, Logic, Language and Computation.

[57]  Benjamin G. Zorn,et al.  Memory allocation costs in large C and C++ programs , 1994, Softw. Pract. Exp..

[58]  Peter Lee,et al.  Signatures for a network protocol stack: a systems application of Standard ML , 1994, LFP '94.

[59]  Zhong Shao,et al.  Compiling standard ML for efficient execution on modern machines , 1994 .

[60]  Mitchell Wand,et al.  Conditional Lambda-Theories and the Verification of Static Properties of Programs , 1994, Inf. Comput..

[61]  James R. Larus,et al.  Rewriting executable files to measure program behavior , 1994, Softw. Pract. Exp..

[62]  Andrew P. Tolmach Tag-free garbage collection using explicit type parameters , 1994, LFP '94.

[63]  Darko Stefanovic,et al.  Characterization of object behaviour in Standard ML of New Jersey , 1994, LFP '94.

[64]  A. Appel Making Lambda Calculus Smaller , Faster , 1994 .

[65]  Robert Harper,et al.  Compiling polymorphism using intensional type analysis , 1995, POPL '95.

[66]  Greg Morrisett,et al.  Compiling with Types , 1995 .

[67]  André L. M. Santos,et al.  Compilation by transformation in non-strict functional languages , 1995 .

[68]  Andrew K. Wright Simple imperative polymorphism , 1995, LISP Symb. Comput..

[69]  Aleksy Schubert,et al.  The EML Kit Version 1 , 1996 .

[70]  Robert Harper,et al.  Typed closure conversion , 1996, POPL '96.

[71]  Robert Harper,et al.  A Type-Theoretic Account of Standard ML 1996 (Version 1). , 1996 .