Lecture Slides
Lectures
Supplemental readings are listed under each lecture. You may find them useful. You are not responsible for the contents not covered in lecture.
-   
- Cooper et al., Ch. 1 Overview of Compilation, p.p. 1-23 (2nd ed.), p.p. 1-26 (3rd ed.)
 
 -  
Specifying Languages with Regular Expressions and Context-Free Grammars (6 slides/page)
- Cooper et al., Ch. 2 Scanners, p.p. 25-82 (2nd ed.), p.p. 27-84 (3rd ed.).
 - Cooper et al., Ch. 3 Parsers, § 3.1-3.2, p.p. 83-95 (2nd ed.), p.p. 85-98 (3rd ed.).
 
 -  
Top-down Parsing (6 slides/page)
- Cooper et al., Ch. 3 Parsers, § 3.3 Top-Down-Parsing, p.p. 96-116 (2nd ed.), p.p. 99-118 (3rd ed.).
 
 - Intermediate Formats (6 slides/page) 
- Cooper et al., Ch. 5 Intermediate Representations, p.p. 221-268 (2nd ed.), Ch. 4, p.p. 159-207 (3rd ed.).
 - Cooper et al., Ch. 6 The Procedure Abstraction, § 6.3 Name Spaces, p.p. 276-297 (2nd ed.).
 - Cooper et al., Ch. 5 Syntax Driven Translation, § 5.4 Modeling the Naming Environment, p.p. 227-239 (3rd ed.).
 
 - Semantic Analysis (6 slides/page) 
- Cooper et al., Ch. 4 Context-Sensitive Analysis, § 4.2 Introduction to Type Systems, p.p. 164-181 (2nd ed.).
 - Cooper et al., Ch. 5 Syntax Driven Translation, § 5.5 Type Information, p.p. 239-251 (3rd ed.).
 
 - Code Generation (6 slides/page) 
- Cooper et al., Ch. 6 The Procedure Abstraction, p.p. 269-330 (2nd ed.).
 - Cooper et al., Ch. 6 Implementing Procedures, p.p. 275-326 (3rd ed.).
 - Cooper et al., Ch. 7 Code shape, p.p. 331-404 (2nd ed.), p.p. 327-378 (3rd ed.).
 
 - Program Analysis and Optimization (6 slides/page)
 - Dataflow Analysis (6 slides/page)
 - Loop Optimizations (6 slides/page)
 - Register Allocation (6 slides/page)
 - Parallelization (6 slides/page)
 - Foundations of Dataflow Analysis (6 slides/page)
 
Optional content
- Shift-Reduce Parsing (6 slides/page) 
- This used to be covered in past semesters. The material is useful for understanding the internals of some parser generators.
 - Cooper et al., Ch. 3 Parsers, § 3.4 Bottom-Up Parsing, p.p. 116-140 (2nd ed.), p.p. 118-142 (3rd ed.).
 
 
Recitations
- Course Information (Slides)
 - Phase 1 (Slides)
 - Recursive Descent Parser (Demo)
 - Parser Generator (Slides, Demo)
 - Phase 2 (Slides, Demo)
 - SSA (Slides)
 - Control Flow Graphs (Slides, Demo)
 - x86 Assembly (Slides)
 - Phase 4 and GDB crash course (Slides)
 - Register Allocation and Peephole Optimization (Slides)
 
Re-lectures from 2024
- Regular expressions, automata, grammars, parse trees (6 pages/slide)
 - High-level IR, semantic checking (6 pages/slide)
 - Code generation (6 pages/slide)
 - Program analysis and optimization (6 pages/slide)
 - Foundations of dataflow analysis (6 pages/slide)
 - Register allocation, loop optimizations, parallelization: see lecture slides L09, L10, and L11.
 
Recordings
All recitations and re-lectures are recorded and published on Panopto.