COMP 506: Compiler Construction, Graduate Edition
Professor Keith D. Cooper
Department of Computer Science
Rice University
Houston, Texas, USA
Spring 2018: Ryon 201, Tuesday & Thursday, 10:50 AM
Course Syllabus

This page contains the PDF format copies of the lecture notes.

Announcements


Lecture Notes

  1. Introduction and Examples

  2. Building a Scanner, Part I   See Chapter 2 in EaC2e and the flex and bison manuals on the Projects page
    Better write-up of Hopcroft's algorithm than the one in EaC2e.
  3. Building a Scanner, Part II

  4. Building a Parser, Part I    Chapter 3 in EaC2e, plus the bison manual manual on the Projects page
  5. Building a Parser, Part II
  6. Building a Parser, Part III    bison input file from slide 7

  7. Intermediate Representations    Chapter 5 in EaC2e

  8. Ad-Hoc Syntax Directed-Translation    Section 4.4 in EaC2e
    Tar file containing example from the lecture
  9. Ad-Hoc Syntax Directed-Translation, Part II
  10. Ad-Hoc Syntax Directed-Translation, Part III, plus handling assignment and material on memory allocation and de-allocation

  11. Code for Array References and Function Calls    Sections from Chapters 6 and 7 in EaC2e
  12. More on Functions
  13. Naming and Addressability

    Midterm Exam: List of topics for the midterm exam

    Material above this line is covered on the midterm exam

  14. The Software Stack           Not in EaC2e
  15. The Memory Hierarchy    Not in EaC2e

  16. Introduction to Code Optimization with Example from Local Value Numbering     Chapter 8 in EaC2e
  17. From Local to Regional Optimization, Superlocal Value Numbering
  18. Beyond Superlocal: DOM and DVNT     Intro to data-flow analysis
  19. A Simple, Classical Code Motion Technique
  20. Loop Unrolling
  21. Global Common Subexpression Analysis and Inline Substitution     Available Expression Analysis

  22. Introduction to Static Single Assignment Form     Chapter 9 in EaC2e
  23. Building Static Single Assignment Form
  24. Translation Out of Static Single Assignment Form
    Paper on copy coalescing referenced in lecture:
    Z. Budimlic, K.D. Cooper, T.J. Harvey, K. Kennedy, T. Oberg, and S.W. Reeves, Fast Copy Coalescing and Live-range Identification, in Proceedings of 2002 SIGPLAN PLDI (doi)

  25. Eliminating Useless and Unreachable Code: DEAD and CLEAN
  26. Instruction Scheduling     Chapter 12 in EaC2e
  27. Scheduling Beyond Basic Blocks

Information for the Final Exam

EaC2e refers to the textbook, Engineering a Compiler, 2nd Edition
This site is maintained by Keith D. Cooper.
He is a terrible e-mail correspondent.