Cooper: Engineering a Compiler, 2e Lecture Slides

Lectures from the Undergraduate Course at Rice

  1. Introduction and Overview
  2. The View from 35,000 Feet
  3. Local Register Allocation and Lab 1


  4. Introduction to Scanners
  5. Regular Expressions, NFAs, DFAs, Thompson's Construction and the Subset Construction(2 classes)
  6. Building Scanners
  7. DFA Minimization, based on Hopcroft's algorithm, along with slides on Brzozowski's algorithm, also found in Lecture 5


  8. Introduction to Parsing
  9. Top-down Parsing I
  10. 10. Top-down Parsing II, including recursive descent parsers and LL(1) parsers
  11. Bottom-up Parsing
  12. LR Parsers I
  13. LR Parsers II, the Canonical LR(1) Table Construction (major overlap with lecture 12)
  14. Parsing Wrap-up and Lab 2 discussion


  15. Context-sensitive Analysis I (2 classes)
  16. Context-sensitive Analysis II


  17. Intermediate Representations


  18. The Procedure Abstraction I
  19. The Procedure Abstraction II
  20. Procedure Abstraction III
  21. Procedure Abstraction IV
  22. Support for Object-Oriented Langauges (OOLs)
  23. Support for Inheritance in OOLs


  24. Code Shape I, Quick Intro to Code Generation & Code Shape for Expressions
  25. Code Shape II, Arrays, Aggregates, & Strings
  26. Code Shape III, Boolean and Relational Expressions, & Control Flow


  27. Introduction to Optimization, terminology & local value numbering
  28. Local tree-height balancing, not used in 2011
  29. Regional Optimization, Superlocal Value Numbering and Loop Unrolling
  30. Global Optimization, Live Analysis


  31. Introduction to Instruction Selection and Peephole-based Selection
  32. Tree-pattern Matching for Instruction Selection


  33. Local Instruction Scheduling with Applications to Lab 3
  34. Instruction Scheduling II: Beyond Basic Blocks
  35. Instruction Scheduling III: Software Pipelining


  36. Global Register Allocation via Graph Coloring
  37. Global Register Allocation via Graph Coloring, Part II
  38. Combining Scheduling and Register Allocation


  • ZIP Archive containing all lecture notes