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.

  1. Introduction (6 slides/page)

    • Cooper et al., Ch. 1 Overview of Compilation, p.p. 1-23 (2nd ed.), p.p. 1-26 (3rd ed.)
  2. 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.).
  3. 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.).
  4. 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.).
  5. 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.).
  6. 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.).
  7. Program Analysis and Optimization (6 slides/page)
  8. Dataflow Analysis (6 slides/page)
  9. Loop Optimizations (6 slides/page)
  10. Register Allocation (6 slides/page)
  11. Parallelization (6 slides/page)
  12. Foundations of Dataflow Analysis (6 slides/page)

Optional content

  1. 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

  1. Course Information (Slides)
  2. Phase 1 (Slides)
  3. Recursive Descent Parser (Demo)
  4. Parser Generator (Slides, Demo)
  5. Phase 2 (Slides, Demo)
  6. SSA (Slides)
  7. Control Flow Graphs (Slides, Demo)
  8. x86 Assembly (Slides)
  9. Phase 4 and GDB crash course (Slides)
  10. Register Allocation and Peephole Optimization (Slides)

Re-lectures from 2024

  1. Regular expressions, automata, grammars, parse trees (6 pages/slide)
  2. High-level IR, semantic checking (6 pages/slide)
  3. Code generation (6 pages/slide)
  4. Program analysis and optimization (6 pages/slide)
  5. Foundations of dataflow analysis (6 pages/slide)
  6. Register allocation, loop optimizations, parallelization: see lecture slides L09, L10, and L11.

Recordings

All recitations and re-lectures are recorded and published on Panopto.