User-Extensible Simplification - Type-Based Optimizer Generators

For abstract data types (ADTs) there are many potential optimizations of code that current compilers are unable to perform. These optimizations either depend on the functional specification of the computational task performed through an ADT or on the semantics of the objects defined. In either case the abstract properties on which optimizations would have to be based cannot be automatically inferred by the compiler. In this paper our aim is to address this level-of-abstraction barrier by showing how a compiler can be organized so that it can make use of semantic information about an ADT at its natural abstract level, before type lowering, inlining, or other traditional compiler steps obliterate the chance. We present an extended case study of one component of a C++ compiler, the simplifier; discuss the design decisions of a new simplifier (simplifier generator) and its implementation in C++; and give performance measurements. The new simplifier is connected to the Gnu C++ compiler and currently performs optimizations at very high level in the front end. When tested with the Matrix Template Library, a library already highly fine-tuned by hand, we achieved run-time improvements of up to six percent.

[1]  Scott W. Haney,et al.  PETE: THE PORTABLE EXPRESSION TEMPLATE ENGINE , 1999 .

[2]  David R. Musser,et al.  STL tutorial and reference guide , 2001 .

[3]  Christopher W. Fraser,et al.  BURG: fast optimal instruction selection and tree parsing , 1992, SIGP.

[4]  Alfred V. Aho,et al.  Optimal Code Generation for Expression Trees , 1976, J. ACM.

[5]  Nathan Myers,et al.  A new and useful template technique: “traits” , 1996 .

[6]  David R. Musser,et al.  Tecton: A Framework for Specifying and Verifying Generic System Components , 1992 .

[7]  Deepak Kapur,et al.  An Overview of the Tecton Proof System , 1994, Theor. Comput. Sci..

[8]  Kei Davis,et al.  C++ expression template performance issues in scientific computing , 1998, Proceedings of the First Merged International Parallel Processing Symposium and Symposium on Parallel and Distributed Processing.

[9]  Jeremy G. Siek,et al.  The Matrix Template Library: A Generic Programming Approach to High Performance Numerical Linear Algebra , 1998, ISCOPE.

[10]  Stanley B. Lippman C++ gems , 1996 .

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

[12]  Bjarne Stroustrup,et al.  C++ Programming Language , 1986, IEEE Softw..

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

[14]  Samuel P. Midkiff,et al.  From Flop to MegaFlops: Java for Technical Computing , 1998, LCPC.

[15]  Krzysztof Czarnecki,et al.  Generative programming - methods, tools and applications , 2000 .

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

[17]  Charles Simonyi The Future is Intentional , 1999, Computer.

[18]  R. Wille Concept lattices and conceptual knowledge systems , 1992 .

[19]  Shigeru Chiba,et al.  A metaobject protocol for C++ , 1995, OOPSLA.

[20]  Johannes Buchmann,et al.  LiDIA : a library for computational number theory , 1995 .

[21]  Alexander A. Stepanov,et al.  The Ada® Generic Library: Linear List Processing Packages , 1989 .

[22]  Sibylle Schupp,et al.  Requirement oriented programming concepts, implications, and algorithms , 2000 .

[23]  Jeremy G. Siek,et al.  A Modern Framework for Portable High-Performance Numerical Linear Algebra , 2000 .

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

[25]  Samuel P. Midkiff,et al.  Efficient support for complex numbers in Java , 1999, JAVA '99.

[26]  Christopher W. Fraser,et al.  Engineering a simple, efficient code-generator generator , 1992, LOPL.

[27]  Amer Diwan,et al.  Type-based alias analysis , 1998, PLDI.

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

[29]  Alexander A. Stepanov,et al.  The Ada® Generic Library , 1989, Springer Compass International.

[30]  Karl Lieberherr,et al.  Adaptive Object-Oriented Software: The Demeter Method with Propagation Patterns , 1995 .

[31]  David R. Musser,et al.  STL tutorial and reference guide - C++ programming with the standard template library , 1996, Addison-Wesley professional computing series.

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