Reduction-Based Optimizer - Initial Version

Abstract

We describe a language for defining term rewriting strategies, and its application to the production of program optimizers. Valid transformations on program terms can be described by a set of rewrite rules; rewriting strategies are used to describe when and how the various rules should be applied in order to obtain the desired optimization effects. Separating rules from strategies in this fashion makes it easier to reason about the behavior of the optimizer as a whole, compared to traditional monolithic optimizer implementations. We illustrate the expressiveness of our language by using it to describe a simple optimizer for an ML-like intermediate representation. The basic strategy language uses operators such as sequential composition, choice, and recursion to build transformers from a set of labeled unconditional rewrite rules. We also define an extended language in which the side-conditions and contextual rules that arise in realistic optimizer specifications can themselves be expressed as strategy-driven rewrites. We show that the features of the basic and extended languages can be expressed by breaking down the rewrite rules into their primitive building blocks, namely matching and building terms in restricted environments. This primitive representation forms the basis of a simple implementation that generates efficient C code.

Open PDF

Document Details

Document Type
Technical Report
Publication Date
Apr 22, 1998
Accession Number
ADA343376

Entities

People

  • Andrew Tolmach
  • Eelco Visser
  • Zine-el-abidine Benaissa

Tags

Communities of Interest

  • Materials and Manufacturing Processes

DTIC Thesaurus Topics

  • Air Force
  • Algorithms
  • Compilers
  • Computer Programming
  • Computer Programs
  • Computer Science
  • Computers
  • Environment
  • High Level Languages
  • Language
  • Notation
  • Optimization
  • Programming Languages
  • Semantics
  • Side Effects
  • Specifications
  • Standards

Readers

  • Computational Linguistics
  • Operations Research