CS4410/6410: Compilers

Spring 2018

Contact information

Office Phone email Office hours
Olin Shivers WVH 318 x3146 shivers@ccs TBD

Lectures are Tuesday 11:45–1:25 and Thursday 2:50–4:30, Shillman 210.

Course schedule (lectures, projects, exams)

Piazza: https://piazza.com/class/jc7tygo11aaub

Slides for intro-to-SML lecture.


  1. Lexer (due Tue 1/25)
  2. Parser (due Thu 2/13)
  3. Static semantics (due Tue 2/22)
  4. Frame analysis (unofficially due Tue 3/6)
  5. Translation to IR (due Tue 3/22)
  6. Instruction selection (due Tue 3/29)
  7. Live-variable Data-flow analyser (due Tue 4/5)
  8. Register allocation (due Tue 4/17)
  9. Integration (due Tue 4/24)




SPIM is a simulator written by James Larus for the MIPS-II ISA, a real-world processor architecture that is a very clean RISC design.


Improved Canonicaliser

Appel provides a module of code for the Tiger-compiler project called the "canonicaliser," which lowers a program in the IR language to a form closer to machine code. This code is hard to read, as the invariants of the lowered/canonicalised form are not expressed in the type of the result form. Well, and the code isn't commented, either.

I rewrote this code using a target data type that makes the new form explicit in the type structure. It is much clearer (as well as voluminously commented). It also has a better commutativity analysis.

The code comes in two forms. The first version is exactly as described above. Then I took that, and converted the improved code to use the original IR data type for the target, producing a version that is a drop-in replacement for Appel's code.

So, read the first version but use the second.