Secretary:  Madelyn Mann
SN 318, Tel: 962-1922, mann@cs.unc.edu
Course Overview
This is a graduate course on the design and implementation of
optimizing compilers for modern programming languages and
computer architectures. The use of compiler generation
tools and algorithms for tree and graph
based representations of programs are emphasized in this course.
A substantial compiler construction project is the principal
assignment in this class.
(for Tue 8/27) Read as much of Appel Ch. 2 (pp 16 - 39) as
possible, but at least through secn 2.3 (pp 16 - 24).
(for Thu 8/22) Read Appel Ch. 1 and try the programming exercise
described starting on page 11. Consider using Java's
Hashtable class as a static member of the class Nonterm,
instead of the Table class described.
If you do not have the text yet, you can
read a
pdf version of Chapter 1
(local access only).
Exercises and assignments
(Due Tue Dec 3) Two problems:
Design a set of dataflow equations to determine the dominator
relations in a control flow graph. Give a procedure to
construct the dominator tree from the relations computed
by your dataflow equations.
Exercise 19.7 on page 475 of Appel.
Note that the second block in a topological ordering of this graph
is mislabeled as 3 when it should be 2. Also note
that the control
flow edges from block 5 are missing their condition labels.
The most sensible labeling is that the edge to block 6 is taken on
condition true, and the edge to block 7 is taken on condition false,
although it really shouldn't matter for this problem (the uselessness
of the second loop in the alternate labeling might be recognized
with a conditional value numbering analysis). Note You must combine all phi-functions at the start of a
basic block into a single simultaneous assignment in order to
be generate the correct interference graph.
The MIPS instruction set, MIPS assembler directives and
the SPIM simulator of the MIPS architecure are summarized in
section A.10 from
Appendix A
of Hennessy and Patterson,
Computer Organization and Design: The Hardware/Software Interface.
Bibliography
Randy Allen and Ken Kennedy, Optimizing Compilers
for Modern Architectures: A Dependence-based Approach,
Morgan Kauffman, 2001. ISBN: 1-558-60286-0
Andrew W. Appel, Modern Compiler Implementation in Java,
Cambridge University Press, 1998. ISBN: 0-521-58388-8
Robert Morgan, Building an Optimizing Compiler,
Butterworth-Heinemann, 1998. ISBN: 01-55558-179-X