The compiler is the programmer's primary tool. Understanding the compiler is therefore critical for programmers, even if they never build one. Furthermore, many design techniques that emerged in the context of compilers are useful for a range of other application areas. This course introduces students to the essential elements of building a compiler: parsing, context-sensitive property checking, code linearization, register allocation, etc. To take this course, students are expected to already understand how programming languages behave, to a fairly detailed degree. The material in the course builds on that knowledge via a series of semantics preserving transformations that start with a fairly high-level programming language and culminate in machine code.
Syllabus
Department page
This class takes materials from two different books (listed in the syllabus) as well as a few research papers.
The result is a set of slides, notes, and code.
Some lectures rely on code and notes (not slides).
All the slides used in the 2022-2023 class are below.
The rest of the material is available only on Canvas.
Materials are improved every year.
They are updated on this website (atomically) only at the end of the class.
Week number | First lecture | Second lecture |
---|---|---|
Week 0 |
Welcome,
Framework |
L1 |
Week 1 |
From L1 to x86_64,
Parsing |
L2,
Liveness analysis |
Week 2 |
Panels about Homework #0
(L1 compiler) |
Interference graph,
Spilling,
Graph coloring |
Week 3 |
Panels about Homework #1 (Liveness),
Advanced graph coloring |
An alternative register allocator: puzzle solving |
Week 4 |
Panels about Homework #2
(Interference graph and spiller) |
L3 and instruction selection |
Week 5 |
Panels about Homework #3
(L2 compiler) |
IR,
Back-end missing pieces |
Week 6 |
Panels about Homework #4
(L3 compiler) |
LA |
Week 7 |
Panels about Homework #5 (IR compiler),
The Time-Squeezer research compiler |
LB,
Competition rules |
Week 8 |
Panels about Homework #6
(LA compiler) |
LC,
LD |
Week 9 |
Panels about Homework #7
(LB compiler) |
Competition! |
Students design and build a complete compiler able to translate an almost-C language to Intel x86-64 machine code. At the end of the class, the resulting compilers compete and the names of the students that designed and built the best compilers are reported below.
Year | Name | Picture |
---|---|---|
2022 - 2023 | Julio Wang |
![]() |
2021 - 2022 | Riley "a11ce" Boksenbaum |
![]() |
2020 - 2021 |
Peter Zhong and
Max Paik |
![]() |
2019 - 2020 | Shu-Hung You |
![]() |
2018 - 2019 |
Vijay Kandiah and
Chenqi Guo |
![]() |
2017 - 2018 | Matt C. Cheung |
![]() |
2016 - 2017 | Zhiping Xiu |
![]() |
Share this page with: