A language for specifying compiler optimizations for generic software

Compiler optimization is important to software performance, and modern processor architectures make optimization even more critical. However, many modern software applications use libraries providing high levels of abstraction. Such libraries often hinder effective optimization—the libraries are difficult to analyze using current compiler technology. For example, high-level libraries often use dynamic memory allocation and indirectly expressed control structures, such as iterator-based loops. Programs using these libraries often cannot achieve an optimal level of performance. On the other hand, software libraries have also been recognized as potentially aiding in program optimization. One proposed implementation of library-based optimization is to allow the library author, or a library user, to define custom analyses and optimizations. Only limited systems have been created to take advantage of this potential, however. One problem in creating a framework for defining new optimizations and analyses is how users are to specify them: implementing them by hand inside a compiler is difficult and prone to errors. Thus, a domain-specific language for library-based compiler optimizations would be beneficial. Many optimization specification languages have appeared in the literature, but they tend to be either limited in power or unnecessarily difficult to use. Therefore, I have designed, implemented, and evaluated the Pavilion language for specifying program analyses and optimizations, designed for library authors and users. These analyses and optimizations can be based on the implementation of a particular library, its use in a specific program, or on the properties of a broad range of types, expressed through concepts. The new system is intended to provide a high level of expressiveness, even though the intended users are unlikely to be compiler experts.

[1]  Yanhong A. Liu,et al.  Querying Complex Graphs , 2006, PADL.

[2]  Jeremy G. Siek,et al.  A language for generic programming , 2005 .

[3]  Sriram K. Rajamani,et al.  Bebop: a path-sensitive interprocedural dataflow engine , 2001, PASTE '01.

[4]  Sriram K. Rajamani,et al.  Thorough static analysis of device drivers , 2006, EuroSys.

[5]  Magne Haveraaen,et al.  Domain-Specific Optimisation with User-Defined Rules in CodeBoost , 2003, Electron. Notes Theor. Comput. Sci..

[6]  Orna Kupferman,et al.  An Improved Algorithm for the Membership Problem for Extended Regular Expressions , 2002, MFCS.

[7]  D. Kozen Results on the Propositional µ-Calculus , 1982 .

[8]  R. Nigel Horspool,et al.  Flow Grammars - a Flow Analysis Methodology , 1994, CC.

[9]  Jaakko Järvi,et al.  An extended comparative study of language support for generic programming , 2007, Journal of Functional Programming.

[10]  Edmund M. Clarke,et al.  Counterexample-guided abstraction refinement , 2003, 10th International Symposium on Temporal Representation and Reasoning, 2003 and Fourth International Conference on Temporal Logic. Proceedings..

[11]  Todd L. Veldhuizen,et al.  Expression templates , 1996 .

[12]  Alexander Okhotin Boolean grammars , 2004, Inf. Comput..

[13]  Todd L. Veldhuizen,et al.  Arrays in Blitz++ , 1998, ISCOPE.

[14]  Ken Kennedy,et al.  Telescoping Languages: A System for Automatic Generation of Domain Languages , 2005, Proceedings of the IEEE.

[15]  Eelco Visser,et al.  Strategies for Source-to-Source Constant Progagation , 2002, Electron. Notes Theor. Comput. Sci..

[16]  Viktor Kuncak,et al.  Generalized typestate checking using set interfaces and pluggable analyses , 2004, SIGP.

[17]  Markus Schordan,et al.  Specifying transformation sequences as computation on program fragments with an abstract attribute grammar , 2005, Fifth IEEE International Workshop on Source Code Analysis and Manipulation (SCAM'05).

[18]  Christoph Pflaum,et al.  Fast Expression Templates , 2005, International Conference on Computational Science.

[19]  Andrew Lumsdaine,et al.  Using MPI with C# and the Common Language Infrastructure , 2005, Concurr. Pract. Exp..

[20]  Jaakko Järvi,et al.  Associated types and constraint propagation for mainstream object-oriented generics , 2005, OOPSLA '05.

[21]  Matthew B. Dwyer,et al.  Bandera: extracting finite-state models from Java source code , 2000, Proceedings of the 2000 International Conference on Software Engineering. ICSE 2000 the New Millennium.

[22]  Alfred V. Aho,et al.  The Design and Analysis of Computer Algorithms , 1974 .

[23]  Shmuel Sagiv,et al.  TVLA: A System for Implementing Static Analyses , 2000, SAS.

[24]  Jaakko Järvi,et al.  Algorithm specialization in generic programming: challenges of constrained generics in C++ , 2006, PLDI '06.

[25]  Robert E. Strom,et al.  Typestate: A programming language concept for enhancing software reliability , 1986, IEEE Transactions on Software Engineering.

[26]  Jaakko Järvi,et al.  Concept-Controlled Polymorphism , 2003, GPCE.

[27]  David Detlefs,et al.  Simplify: a theorem prover for program checking , 2005, JACM.

[28]  Ken Kennedy,et al.  Optimizing strategies for telescoping languages: procedure strength reduction and procedure vectorization , 2001, ICS '01.

[29]  James C. Corbett,et al.  A Language Framework for Expressing Checkable Properties of Dynamic Software , 2000, SPIN.

[30]  Robert Paige,et al.  Viewing A Program Transformation System At Work , 1994, Symposium on Programming Language Implementation and Logic Programming.

[31]  Calvin Lin,et al.  Broadway: A Compiler for Exploiting the Domain-Specific Semantics of Software Libraries , 2005, Proceedings of the IEEE.

[32]  G. Karakitsos A language for specifying program transformations , 1994, Proceedings of 1994 1st International Conference on Software Testing, Reliability and Quality Assurance (STRQA'94).

[33]  Mary Lou Soffa,et al.  Automatic generation of global optimizers , 1991, PLDI '91.

[34]  Javier Esparza,et al.  Efficient Algorithms for Model Checking Pushdown Systems , 2000, CAV.

[35]  Bernhard Steffen,et al.  Towards a tool kit for the automatic generation of interprocedural data flow analyses , 1996, J. Program. Lang..

[36]  Daniel Kroening,et al.  Over-Approximating Boolean Programs with Unbounded Thread Creation , 2006, 2006 Formal Methods in Computer Aided Design.

[37]  Steven W. K. Tjiang,et al.  Sharlit—a tool for building optimizers , 1992, PLDI '92.

[38]  W. Pedrycz,et al.  Regular expressions with truth values in lattice-monoid and their languages , 2004, IEEE Annual Meeting of the Fuzzy Information, 2004. Processing NAFIPS '04..

[39]  Eitan M. Gurari,et al.  Introduction to the theory of computation , 1989 .

[40]  Michael J. Vilot,et al.  Standard template library , 1996 .

[41]  Javier Esparza,et al.  Reachability Analysis of Pushdown Automata: Application to Model-Checking , 1997, CONCUR.

[42]  Ondrej Lhoták,et al.  Adding trace matching with free variables to AspectJ , 2005, OOPSLA '05.

[43]  Uwe A Mann Graph Rewrite Systems For Program Optimization , 2000 .

[44]  Calvin Lin,et al.  An annotation language for optimizing software libraries , 1999, DSL '99.

[45]  Jeffrey D. Ullman,et al.  Introduction to Automata Theory, Languages and Computation , 1979 .

[46]  Douglas Gregor,et al.  Generic Programming and High-Performance Libraries ( Preprint ) , 2005 .

[47]  Randal E. Bryant,et al.  Graph-Based Algorithms for Boolean Function Manipulation , 1986, IEEE Transactions on Computers.

[48]  Jeremy G. Siek,et al.  The Boost Graph Library - User Guide and Reference Manual , 2001, C++ in-depth series.

[49]  Matthew Flatt,et al.  PLT MzScheme: Language Manual , 2000 .

[50]  Eric Van Wyk,et al.  Universal Regular Path Queries , 2003, High. Order Symb. Comput..

[51]  Markus Schordan,et al.  A Source-to-Source Architecture for User-Defined Optimizations , 2003, JMLC.

[52]  Sorin Lerner,et al.  Automatically Inferring Sound Dataflow Functions from Dataflow Fact Schemas , 2005 .

[53]  Peter Lee,et al.  Trace-based program analysis , 1996, POPL '96.

[54]  Magne Haveraaen,et al.  Design of the CodeBoost transformation system for domain-specific optimisation of C++ programs , 2003, Proceedings Third IEEE International Workshop on Source Code Analysis and Manipulation.

[55]  Martin Alt,et al.  Generation of Efficient Interprocedural Analyzers with PAG , 1995, SAS.

[56]  Tayssir Touili,et al.  A Generic Approach to the Static Analysis of Concurrent Programs with Procedures , 2003, Int. J. Found. Comput. Sci..

[57]  Jaakko Järvi,et al.  Algorithm specialization and concept-constrained genericity , 2004 .

[58]  Bjarne Stroustrup,et al.  Concepts: linguistic support for generic programming in C++ , 2006, OOPSLA '06.

[59]  Yanhong A. Liu,et al.  Parametric regular path queries , 2004, PLDI '04.

[60]  Rodney Farrow Automatic generation of fixed-point-finding evaluators for circular, but well-defined, attribute grammars , 1986, SIGPLAN '86.

[61]  Sorin Lerner,et al.  Automatic inference of optimizer flow functions from semantic meanings , 2007, PLDI '07.

[62]  Jaakko Järvi,et al.  An Analysis of Constrained Polymorphism for Generic Programming , 2003 .

[63]  Dawson R. Engler,et al.  Interface Compilation: Steps Toward Compiling Program Interfaces as Languages , 1999, IEEE Trans. Software Eng..

[64]  Flemming Nielson,et al.  Normalizable Horn Clauses, Strongly Recognizable Relations, and Spi , 2002, SAS.

[65]  David Scott Warren,et al.  Memoing for logic programs , 1992, CACM.

[66]  David A. Wagner,et al.  MOPS: an infrastructure for examining security properties of software , 2002, CCS '02.

[67]  Douglas Gregor,et al.  Proposed Wording for Concepts , 2007 .

[68]  Dawson R. Engler,et al.  Checking system rules using system-specific, programmer-written compiler extensions , 2000, OSDI.

[69]  Sibylle Schupp,et al.  Semantic and behavioral library transformations , 2002, Inf. Softw. Technol..

[70]  Sibylle Schupp,et al.  Making the Usage of STL Safe , 2002, Generic Programming.

[71]  Letizia Tanca,et al.  Logic Programming and Databases , 1990, Surveys in Computer Science.

[72]  Murray Hill,et al.  Yacc: Yet Another Compiler-Compiler , 1978 .

[73]  Dennis Gannon,et al.  Active Libraries: Rethinking the roles of compilers and libraries , 1998, ArXiv.

[74]  Yannis Smaragdakis,et al.  Static interfaces in C , 2000 .

[75]  Sagar Chaki,et al.  Verifying Concurrent Message-Passing C Programs with Recursive Calls , 2006, TACAS.

[76]  Gerard J. Holzmann,et al.  Logic Verification of ANSI-C Code with SPIN , 2000, SPIN.

[77]  Craig Chambers,et al.  Towards automatic construction of staged compilers , 2002, POPL '02.

[78]  Benjamin Livshits,et al.  Context-sensitive program analysis as database queries , 2005, PODS.

[79]  Ken Kennedy,et al.  Procedure cloning , 1992, Proceedings of the 1992 International Conference on Computer Languages.

[80]  Sibylle Schupp,et al.  User-Extensible Simplification - Type-Based Optimizer Generators , 2001, CC.

[81]  Charles N. Fischer,et al.  Interactive, scalable, declarative program analysis: from prototype to implementation , 2007, PPDP '07.

[82]  G. Ramalingam,et al.  Context-sensitive synchronization-sensitive analysis is undecidable , 2000, TOPL.

[83]  David A. Schmidt Data flow analysis is model checking of abstract interpretations , 1998, POPL '98.

[84]  Jeremy G. Siek,et al.  The generic graph component library , 1999, OOPSLA '99.

[85]  Oege de Moor,et al.  Incremental Program Analysis via Language Factors , 2002 .

[86]  Alexander A. Stepanov,et al.  C++ Standard Template Library , 2000 .

[87]  Graham Hutton,et al.  Higher-order functions for parsing , 1992, Journal of Functional Programming.

[88]  Keith D. Cooper,et al.  Combining analyses, combining optimizations , 1995, TOPL.

[89]  Alexander Okhotin,et al.  The dual of concatenation , 2005, Theor. Comput. Sci..

[90]  David R. Musser,et al.  Code-carrying theory , 2008, SAC '08.

[91]  Alexander Aiken,et al.  Flow-sensitive type qualifiers , 2002, PLDI '02.

[92]  David Ryan Koes,et al.  Programmer specified pointer independence , 2004, MSP '04.

[93]  Thomas W. Reps,et al.  Improving Pushdown System Model Checking , 2006, CAV.

[94]  Ken Friis Larsen,et al.  Incremental execution of transformation specifications , 2004, POPL.

[95]  Javier Esparza,et al.  A BDD-Based Model Checker for Recursive Programs , 2001, CAV.

[96]  Kwangkeun Yi,et al.  Automatic generation and management of interprocedural program analyses , 1993, POPL '93.

[97]  David R. Musser,et al.  A Formalization of Concepts for Generic Programming , 2004 .

[98]  Charles N. Fischer,et al.  SPARE: A Development Environment For Program Analysis Algorithms , 1992, IEEE Trans. Software Eng..

[99]  Grant Martin,et al.  IP Reuse Hardening via Embedded Sugar Assertions , 2002 .

[100]  Charles L. Lawson,et al.  Basic Linear Algebra Subprograms for Fortran Usage , 1979, TOMS.

[101]  Sibylle Schupp,et al.  Concept-based component libraries and optimizing compilers , 2002, Proceedings 16th International Parallel and Distributed Processing Symposium.

[102]  Todd L. Veldhuizen,et al.  Using C++ template metaprograms , 1996 .

[103]  Dana Fisman,et al.  Embedding finite automata within regular expressions , 2008, Theor. Comput. Sci..

[104]  Joseph Y. Halpern,et al.  “Sometimes” and “not never” revisited: on branching versus linear time temporal logic , 1986, JACM.

[105]  Sibylle Schupp,et al.  Library transformations , 2001, Proceedings First IEEE International Workshop on Source Code Analysis and Manipulation.

[106]  Patrick Cousot,et al.  Static determination of dynamic properties of programs , 1976 .

[107]  Hisao Tamaki,et al.  OLD Resolution with Tabulation , 1986, ICLP.

[108]  Murray Hill,et al.  Lint, a C Program Checker , 1978 .

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

[110]  Vineet Kahlon,et al.  On the analysis of interacting pushdown systems , 2007, POPL '07.

[111]  Alexander A. Stepanov,et al.  Generic Programming , 1988, ISSAC.

[112]  Eelco Visser,et al.  Stratego: A Language for Program Transformation Based on Rewriting Strategies , 2001, RTA.

[113]  Oege de Moor,et al.  Transforming the .NET intermediate language using path logic programming , 2002, PPDP '02.

[114]  Matthew H. Austern Generic programming and the STL - using and extending the C++ standard template library , 1999, Addison-Wesley professional computing series.

[115]  Gary A. Kildall,et al.  A unified approach to global program optimization , 1973, POPL.

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

[117]  Magne Haveraaen,et al.  CodeBoost : a framework for transforming C++ programs , 2001 .

[118]  Deepak Goyal,et al.  Deriving specialized program analyses for certifying component-client conformance , 2002, PLDI '02.

[119]  Eric Van Wyk,et al.  Compiler Optimization Correctness by Temporal Logic , 2004, High. Order Symb. Comput..

[120]  Sorin Lerner,et al.  Automated soundness proofs for dataflow analyses and transformations via local rules , 2005, POPL '05.

[121]  Ken Kennedy,et al.  Telescoping languages: a compiler strategy for implementation of high-level domain-specific programming systems , 2000, Proceedings 14th International Parallel and Distributed Processing Symposium. IPDPS 2000.

[122]  C. R. Ramakrishnan,et al.  Practical program analysis using general purpose logic programming systems—a case study , 1996, PLDI '96.

[123]  Eric Van Wyk,et al.  Using Model Checking in a Parallelizing Compiler , 1998, Parallel Process. Lett..

[124]  C. R. Ramakrishnan,et al.  Incremental and demand-driven points-to analysis using logic programming , 2005, PPDP.

[125]  Ken Kennedy,et al.  Information Technology Research Investing in Our Future , 1999 .

[126]  Sorin Lerner,et al.  Automatically proving the correctness of compiler optimizations , 2003, PLDI '03.

[127]  Lori A. Clarke,et al.  Flow analysis for verifying properties of concurrent software systems , 2004, TSEM.

[128]  Terence J. Harmer,et al.  The TAMPR Program Transformation System: Simplifying the Development of Numerical Software , 1997, SciTools.

[129]  Hubert Comon,et al.  Tree automata techniques and applications , 1997 .

[130]  Arch D. Robison,et al.  Impact of economics on compiler optimization , 2001, JGI '01.

[131]  Jeremy G. Siek,et al.  Caramel: A Concept Representation System for Generic Programming , 2001 .

[132]  Bernhard Steffen,et al.  Data Flow Analysis as Model Checking , 1990, TACS.

[133]  Søren Debois Imperative program optimization by partial evaluation , 2004, PEPM '04.

[134]  Robert K. Brayton,et al.  Algorithms for discrete function manipulation , 1990, 1990 IEEE International Conference on Computer-Aided Design. Digest of Technical Papers.

[135]  Steve W. Otto,et al.  A Class-Specific Optimizing Compiler , 1993, Sci. Program..

[136]  Douglas Gregor,et al.  STLlint: lifting static checking from languages to libraries , 2006 .

[137]  Eelco Visser,et al.  Rewriting Strategies for Instruction Selection , 2002, RTA.

[138]  Andrew Lumsdaine,et al.  Accelerating sparse matrix computations via data compression , 2006, ICS '06.

[139]  Bronis R. de Supinski,et al.  A C++ Infrastructure for Automatic Introduction and Translation of OpenMP Directives , 2003, WOMPAT.

[140]  Koushik Sen,et al.  Generating Optimal Monitors for Extended Regular Expressions , 2003, RV@CAV.

[141]  Jaakko Järvi,et al.  A comparative study of language support for generic programming , 2003, OOPSLA 2003.

[142]  Shane Markstrum,et al.  Semantic type qualifiers , 2005, PLDI '05.

[143]  Oege de Moor,et al.  Imperative Program Transformation by Rewriting , 2001, CC.

[144]  Sorin Lerner,et al.  Composing dataflow analyses and transformations , 2002, POPL '02.

[145]  Bronis R. de Supinski,et al.  Semantic-Driven Parallelization of Loops Operating on User-Defined Containers , 2003, LCPC.

[146]  Martin Kay,et al.  Regular Models of Phonological Rule Systems , 1994, CL.

[147]  Benjamin Livshits,et al.  Finding application errors and security flaws using PQL: a program query language , 2005, OOPSLA '05.

[148]  Oege de Moor,et al.  JunGL: a scripting language for refactoring , 2006, ICSE.

[149]  Thomas A. Henzinger,et al.  The Blast Query Language for Software Verification , 2004, SAS.

[150]  Hiroaki Yamamoto An Automata-Based Recognition Algorithm for Semi-extended Regular Expressions , 2000, MFCS.