Realizing Domain-specific Compiler Optimizations via Generic Programming - Archive ouverte HAL Accéder directement au contenu
Communication Dans Un Congrès Année : 2008

Realizing Domain-specific Compiler Optimizations via Generic Programming

Résumé

Contemporary mainstream programming languages offer mechanisms for expressing domain-specific abstractions, but these languages and their compilers fall short in support for optimizing the use of such abstractions. Optimizations rules in compilers are typically hard-coded and apply only for "low-level" operations of built-in types; there are no mechanisms for defining domain-specific optimization rules or strategies that would apply to a specific set of user-defined types. Addressing this discrepancy has been an active area of research (1; 2; 3; 4; 5; 6; 7). Approaches, such as Active Libraries (8) and Simplicissimus (2), exploit compilers' abilities to perform computations, e.g. template metaprogramming. These approaches can be applied to new domains with relative ease, but are limited in that they are flow-insensitive and do not integrate well with other compiler optimizations; the computations (and thus domain-specified optimizations) must occur in the front-end where flow information is typically not accessible. In contrast, lightweight optimization tools, such as CodeBoost (3), and full-fledged compilers, such as Telescoping languages (9) and the BroadWay compiler (6), allow more powerful domain-specific optimizations by devising their own program analyses and optimizations, whose functionalities and implementations overlap those of traditional compilers; the effort of developing and maintaining domain-specific optimizations for a given domain may be more involved with these approaches. Assuming a system that supports expressing domain specific user-defined optimizations, the programming tasks that are necessary to enable such optimizations are, first, to describe the domain-specific transformation rules for specific types and their operations, and, second, to annotate the programs to indicate where the transformations should apply. Regarding the first task, it is not realistic to expect all programmers to provide type-specific optimization rules for all new user-defined types. Authors of widely used libraries could, however, engage to such an effort if the effort was reasonable and amortized over many uses of the abstractions offered by the library. Regarding the second task, the burden of annotating programs to enable domain-specific optimizations should be very light, preferably incurring no burden at the client side, when using abstractions that support domain-specific optimizations. Our work studies the potential of generic programming for easy expression of generic optimization rules in libraries, and very lightweight annotations to enable those rules: both the expression of the rules, as well as the annotations are part of the normal course of generic programming, that encourages the explicit expression of abstractions' semantic properties. Furthermore, we explore a mechanism to make domain-specific optimizations flow-sensitive, so that they can be applied when traditional optimizations, such as inlining and copy propagation, reveal more optimization opportunities.
Fichier principal
Vignette du fichier
8.pdf (132.71 Ko) Télécharger le fichier
Origine : Fichiers produits par l'(les) auteur(s)

Dates et versions

hal-00350271 , version 1 (06-01-2009)

Identifiants

  • HAL Id : hal-00350271 , version 1

Citer

Xiaolong Tang, Jaakko Järvi. Realizing Domain-specific Compiler Optimizations via Generic Programming. Domain-Specific Program Development, 2008, Nashville, United States. pp.8. ⟨hal-00350271⟩

Collections

DSPD2008
56 Consultations
122 Téléchargements

Partager

Gmail Facebook X LinkedIn More