Efficient retargetable code generation using bottom-up tree pattern matching

https://doi.org/10.1016/0096-0551(90)90006-BGet rights and content

Abstract

Instruction selection is the primary task in automatic code generation. This paper proposes a practical system for performing optimal instruction selection based on tree pattern matching for expression trees. A significant feature of the system is its ability to perform code generation without requiring cost analysis at code generation time. The target machine instructions are specified as attributed production rules in a regular tree grammar augmented with cost information in Graham-Glanville style. Instruction selection is modelled as a process of determining minimum cost derivation for a given expression tree.

A matching automaton is used for instruction selection. Cost information is encoded into the states of this automaton so that cost analysis is not required at code generation time. The folding technique of table compression is extended to this automaton and two schemes of table compression based on cost information are proposed.

References (17)

  • M. Ganapathi et al.

    Retargetable compiler code generation

    Comput. Surv.

    (December 1982)
  • S. Graham

    Table driven code generators

    IEEE Comput.

    (August 1980)
  • B. Leverett et al.

    An overview of the production-quality compiler-compiler project

    IEEE Comput.

    (August 1980)
  • C.G. Bell et al.

    Computer Structures: Reading and Examples

    (1971)
  • R.R. Henry

    Graham-Glanville code-generators

  • Aho, A. V., Ganapathi, M. and Tjiang, S. W. K. Code generation using tree matching and dynamic programming. ACM TOPLAS....
  • A.V. Aho et al.

    Optimal code generation for expression trees

    J. ACM

    (1976)
  • P.J. Hatcher et al.

    High quality code generation via bottom-up tree pattern matching

There are more references available in the full text version of this article.

Cited by (0)

View full text