Proceedings of the tenth annual conference on Object-oriented programming systems, languages, and applications
C/C++ Users Journal
Impact of economics on compiler optimization
Proceedings of the 2001 joint ACM-ISCOPE conference on Java Grande
Automatically proving the correctness of compiler optimizations
PLDI '03 Proceedings of the ACM SIGPLAN 2003 conference on Programming language design and implementation
Active libraries and universal languages
Active libraries and universal languages
Concepts: linguistic support for generic programming in C++
Proceedings of the 21st annual ACM SIGPLAN conference on Object-oriented programming systems, languages, and applications
LCSD '07 Proceedings of the 2007 Symposium on Library-Centric Software Design
Reusable, generic program analyses and transformations
GPCE '09 Proceedings of the eighth international conference on Generative programming and component engineering
A declarative framework for analysis and optimization
CC'07 Proceedings of the 16th international conference on Compiler construction
CC'05 Proceedings of the 14th international conference on Compiler Construction
Hi-index | 0.01 |
Compilers are typically hardwired to attempt optimizations only on expressions involving particular built-in types. Ideally, an optimizing compiler can recognize a rewrite opportunity whenever the operands in an expression satisfy the (algebraic) properties that justify the rewrite. This paper applies the principles and techniques of generic programming and the planned "concepts" language feature of C++ to approximate this ideal. Concretely, a concept defines the signature and algebraic laws of a class of types. We attach rewrite rules to a concept, so that the rules apply to all types in the class defined by a concept. The annotation burden to a programmer is thus small---the declaration that a type models a particular concept is simultaneously taken as an annotation that enables optimizations. To increase the applicability of generic rewrite rules, we instantiate them to type-specific rules, enabling the use of data-flow information from the compiler's existing analyses, and interleave the application of rewrite rules with function inlining. Our prototype is implemented as an extension of the ConceptGCC compiler; our experiments show the approach is effective in eliminating abstraction penalties.