From: | Thomas Lindgren <thomasl@erix.ericsson.se> |
Newsgroups: | comp.compilers |
Date: | 1 Jul 1998 22:50:11 -0400 |
Organization: | Ericsson Telecom AB, Stockholm, Sweden |
References: | 98-06-045 98-06-068 98-06-149 98-06-150 98-06-159 |
Keywords: | books |
Ray Dillinger <bear@sonic.net> writes:
> [compiler textbooks]
The main contenders at this time are:
S. Muchnik.
Advanced Compiler Design and Implementation.
Morgan-Kaufman, 1997.
R. Morgan.
Building an Optimizing Compiler.
Digital Press, 1998.
A. Appel.
Modern Compiler Implementation in ML.
(Note: _not_ the edition subtitled "basic techniques")
Cambridge University Press, 1998.
My recommendation: buy at least Morgan and Muchnik. (If I had to
choose between the two, I _think_ I'd buy Morgan first, but Muchnik is
a bit broader in scope; if you're serious, you definitely want both.)
Muchnik sits somewhere between the encyclopediac and the more
specific. It has sections on most whatever compiler optimization you
can think of, but is a bit dry and doesn't always get into the details
in the way you'd like. (In Muchnik's defense, the book would have been
a lot longer if he had.) I would have liked it to have a better
descriptions of partial redundancy elimination, global instruction
scheduling and code generation (BURS). More on BURS can be found in
Fraser and Hanson's book on LCC (A Retargetable C Compiler) and in
various dissertations (Proebsting and Pelegri-Lloparti, among others).
There's also some annoying errata to be downloaded.
I like Morgan's book. It goes through the details of how to build a
practical optimizing compiler without skipping too many steps,
including a lot of tricks and tweaks that I haven't seen elsewhere.
He also looks into a lot of details that are skimmed by others.
(E.g., combining local and global register allocation; global
instruction scheduling; various details of PRE; etc.) Unfortunately,
Morgan deliberately doesn't go far into interprocedural analysis,
inlining and loop unrolling, which are important for more modern
languages. Well worth buying, anyway.
Appel's book is intended mainly for a first course on compilers and
has a long part treating parsing, etc. The "advanced topics" section
(half of the book, or a bit more) has a reasonable introduction to
high-level languages, GC and so on. The part I liked best is the
description of static single assignment form, which is very lucid.
Furthermore, Appel is a very good writer and provides a reasonable and
pedagogic introduction to the field. A bit lightweight for the really
serious student, though.
J. Hennessy, D. Patterson.
Computer Architecture: A Quantitative Approach (2nd ed).
Morgan-Kaufman.
You can also take a look at Hennessy and Patterson. The motivations
for compiler optimizations can't be beat :-) When it's time to write
the low-level portions, it's nice to have this book to refer to.
(Along with the chip manual.)
Michael Wolfe's 1996 book (can't remember the title at this time)
is probably state of the art for Fortran compilers. There are a couple
of books on dependence analysis as well (Banerjee is the name I recall
here).
I'll plug Scott Mahlke's Ph.D. thesis as well, if you want to compile
for IA-64. (From what I can see, the machine model he uses is very
close to that of HP labs, which in turn seems very close to what is
known of IA-64.) It's impressive. You can find it at the IMPACT
compiler project at University of Illinois, Urbana-Champaign. Lots of
goodies there.
For functional languages:
A. Appel.
Compiling with Continuations.
Cambridge University Press.
You should also look at various theses over the years. Guy Steele's masters
(MIT), David Kranz's Ph.D. (Yale?) and David Tarditi's Ph.D. (CMU) are
well worth reading.
Thomas
--
Thomas Lindgren thomasl@erix.ericsson.se
Software Architecture Research Centre
Ericsson Telecom AB
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.