scispace - formally typeset
Open Access

Automatically generating the back end of a compiler using declarative machine descriptions

Reads0
Chats0
TLDR
This work shows how, for machines of practical interest, to generate the back end of a compiler, using the compiler architecture developed by Davidson and Fraser (1984), which can generate a naive instruction selector and rely upon a machine-independent optimizer to improve the machine instructions.
Abstract
Although I have proven that the general problem is undecidable, I show how, for machines of practical interest, to generate the back end of a compiler. Unlike previous work on generating back ends, I generate the machine-dependent components of the back end using only information that is independent of the compiler's internal data structures and intermediate form. My techniques substantially reduce the burden of retargeting the compiler: although it is still necessary to master the target machine's instruction set, it is not necessary to master the data structures and algorithms in the compiler's back end. Instead, the machine-dependent knowledge is isolated in the declarative machine descriptions. The largest machine-dependent component in a back end is the instruction selector. Previous work has shown that it is difficult to generate a high-quality instruction selector. But by adopting the compiler architecture developed by Davidson and Fraser (1984), I can generate a naive instruction selector and rely upon a machine-independent optimizer to improve the machine instructions. Unlike previous work, my generated back ends produce code that is as good as the code produced by hand-written back ends. My code generator translates a source program into tiles, where each tile implements a simple computation like addition. To implement the tiles, I compose machine instructions in sequence and use equational reasoning to identify sequences that implement tiles. Because it is undecidable whether a tile can be implemented, I use a heuristic to limit the set of sequences considered. Unlike standard heuristics, which may limit the length of a sequence, the number of sequences considered, or the complexity of the result computed by a sequence, my heuristic uses a new idea: to limit the amount of reasoning required to show that a sequence of instructions implements a tile. The limit, which is chosen empirically, enables my search to find instruction selectors for the x86, PowerPC, and ARM in a few minutes each.

read more

Citations
More filters
Journal ArticleDOI

Phd by thesis

TL;DR: In this paper, a sedimentological core and petrographic characterisation of samples from eleven boreholes from the Lower Carboniferous of Bowland Basin (Northwest England) is presented.
Book ChapterDOI

Term Rewriting Systems

TL;DR: This chapter presents the basic concepts of term rewriting that are needed in this book and suggests several survey articles that can be consulted.
Proceedings ArticleDOI

Automatically generating instruction selectors using declarative machine descriptions

TL;DR: By generating the instruction selector from declarative machine descriptions, this work has made it unnecessary for one person to be both a compiler expert and a machine expert, and made creating an optimizing back end easier than ever before.

A Transformation-Based Foundation for Semantics-Directed Code Generation

TL;DR: This dissertation proposes a transformation-based foundation for deriving compilers from semantic specifications in the form of four rules that give apriori advice for staging, and allow explicit compiler derivation that would be less succinct with partial evaluation.

Generalized instruction selector generation: the automatic construction of instruction selectors from descriptions of compiler internal forms and target machines

TL;DR: This dissertation proposes a generalized approach toward generating instruction selectors automatically using CISL, a common machine description language for specifying the semantics of compiler IR and target instructions, and GIST, a machine independent heuristic search procedure that can find equivalent instruction sequences between compiler IRand target instructions.
References
More filters
Journal ArticleDOI

Phd by thesis

TL;DR: In this paper, a sedimentological core and petrographic characterisation of samples from eleven boreholes from the Lower Carboniferous of Bowland Basin (Northwest England) is presented.
Book

Compilers: Principles, Techniques, and Tools

TL;DR: This book discusses the design of a Code Generator, the role of the Lexical Analyzer, and other topics related to code generation and optimization.
Book

The Java Virtual Machine Specification

Tim Lindholm, +1 more
TL;DR: In this article, the authors present a detailed overview of the Java Virtual Machine, including the internal structure of the class file format, the internal form of Fully Qualified Class and Interface names, and the implementation of new class instances.
Proceedings ArticleDOI

Valgrind: a framework for heavyweight dynamic binary instrumentation

TL;DR: Valgrind is described, a DBI framework designed for building heavyweight DBA tools that can be used to build more interesting, heavyweight tools that are difficult or impossible to build with other DBI frameworks such as Pin and DynamoRIO.