Reading Guidelines

The following reading guidelines are divided into the three course modules. Please consider this page and prepare yourself. In the following, the course book is referred to as C&T for the book Keith D. Cooper & Linda Torczon. Engineering a Compiler. Second Edition, Morgan Kaufmann, 2012. Please see the literature webpage for more information.

General Study Advice 

  • Lecture slides: Attend the lectures. Go through all slides very carefully after the lectures.
  • Videos: Listen to the recorded short videos (theory videos and practical coding videos).
  • Read selected parts of the textbooks. See the guidelines below. You can both read in advance before the lectures and check out concepts that you did not understand during the lectures. Please note also that you can easily find concepts in the books by using the Index (at the end of the books).
  • Hacking Sessions. Attend the hacking sessions. To get most out of it, try to advance as far as you can with the assignments before the hacking sessions. If you run into problems, write down the questions and then ask them at the hacking session. Also, a good idea is to form small student groups and study together. You are allowed to discuss how you solve the programming assignments, but you must solve each of the assignments individually. 
  • Write questions and answers on Canvas. Ask questions and try to help your fellow students by making a Q&A on Canvas! The teaching assistants will be there to help you.

Module 1: Lexical Analysis, Syntax Analysis, and Semantic Analysis

Key concepts: Syntax, Semantics, Type Checking, Semantic Analysis, Static vs. Dynamic semantics, Chomsky Hierarchy, Lexical Analysis, Syntactic Sugar, Scanning, Regular Expressions, Finite Automata, DFA, NFA, Syntax Analysis, Parsing, Context-free grammar, LL vs. LR Parsing, Precedence Climbing, Program Representation, Abstract Syntax Tree, Interpretation, and Symbol Table. 

  • Compiler overview: C&T Chapters 1.1 - 1.4
  • Lexing and scanning: C&T Chapters 2.1 - 2.5
  • Parsing: C&T Chapters 3.1 - 3.5. Focus on 3.2 and 3.3.
  • Type systems: C&T Chapters 4.1 - 4.2. Background reading. You can skip this part in the beginning.

Module 2: Code Generation and Runtime Environments

Key concepts: Assembly, x86, Transformations, Garbage Collection, Reference counting, Mark-and-sweep collection, Copying collection, Generational Collection, Incremental Collection, Heap, Stack, Parameter Passing, Activation Records, Closures, Stack frames, Intermediate Code, Control-Flow Graphs, JIT, Basic Blocks, Linking, and Loading.

  • Intermediate Representation: C&T 5.1 - 5.5. Focus on the first section, to get an overview of different IRs. 
  • Procedure Abstraction: C&T 6.1 - 6.5, excluding 6.3.3-6.3.4. Start with 6.2 and 6.4 which are the most important sections for the assignments.
  • Code Shape: C&T 7.1 - 7.10. Look through the content and read the parts that you need while doing the assignments. 
  • Instruction Selection: C&T 11.1 - 11.5. This is an important chapter for the module. Read the introduction and then focus on 11.3 and 11.4. See 11.5 as background reading. 
  • Memory management: Section 6.6. The book does not go into any depth on this topics. You may read this section as background reading. See lecture 6 for details.  

Module 3: Program Analysis and Optimizations

Key concepts: Intermediate Optimization, Dominators, Loop Optimization, Common Subexpression Elimination, Algebraic Simplification, Instruction Scheduling, Pipelining, Register Allocation, Graph Coloring, Static Single Assignment (SSA), Copy Propagation, Constant Propagation, Subword Level Parallelism, and Whole Program Analysis

  • Register allocation C&T Chapters 13.1-13.4.
  • Instruction Scheduling 12.1 - 1.2
  • Data-flow analysis C&T Chapters 9.1 - 9.2
  • Static Single Assignment (SSA) C&T Chapter 9.3
  • Optimization C&T Chapters 8.1 - 8.7. See as background reading