Converting Intermediate Code to Assembly Code Using Declarative Machine Descriptions

Writing an optimizing back end is expensive, in part because it requires mastery of both a target machine and a compiler's internals. We separate these concerns by isolating target-machine knowledge in declarative machine descriptions. We then analyze these descriptions to automatically generate machine-specific components of the back end. In this work, we generate a recognizer; this component, which identifies register transfers that correspond to target-machine instructions, plays a key role in instruction selection in such compilers as vpo, gcc and Quick C–. We present analyses and transformations that address the major challenge in generating a recognizer: accounting for compile-time abstractions not present in a machine description, including variables, pseudo-registers, stack slots, and labels.

[1]  Norman Ramsey,et al.  Automatic Checking of Instruction Specifications , 1997, Proceedings of the (19th) International Conference on Software Engineering.

[2]  Jack W. Davidson,et al.  Machine Descriptions to Build Tools for Embedded Systems , 1998, LCTES.

[3]  Christopher W. Fraser,et al.  Code selection through object code optimization , 1984, TOPL.

[4]  Lee D. Feigenbaum Automated Translation: Generating a Code Generator , 2001 .

[5]  Jürg Gutknecht,et al.  Programming Languages and System Architectures , 1994, Lecture Notes in Computer Science.

[6]  Norman Ramsey,et al.  Specifying representations of machine instructions , 1997, TOPL.

[7]  Jens Tröger,et al.  Specification-driven dynamic binary translation , 2005 .

[8]  Christoph M. Hoffmann,et al.  Pattern Matching in Trees , 1982, JACM.

[9]  Norman Ramsey,et al.  When Do Match-compilation Heuristics Matter? , 2000 .

[10]  Todd A. Proebsting Simple and efficient BURS table generation , 1992, PLDI '92.

[11]  Manuel E. Benitez,et al.  The Advantages of Machine-Dependent Global Optimization , 1994, Programming Languages and System Architectures.

[12]  Norman Ramsey,et al.  Declarative Composition of Stack Frames , 2004, CC.

[13]  Gerry Kane,et al.  MIPS RISC Architecture , 1987 .

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

[15]  Susan L. Graham,et al.  A new method for compiler code generation , 1978, POPL '78.

[16]  Rainer Leupers,et al.  C Compiler Retargeting Based on Instruction Semantics Models , 2005, Design, Automation and Test in Europe.

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

[18]  David R. Chase,et al.  An improvement to bottom-up tree pattern matching , 1987, POPL '87.