Skip to main content Link Search Menu Expand Document (external link)

Theme: auto

Syllabus

Remote Attendance

This course does not support remote attendance. Lectures will not be recorded nor available on Zoom. In some class meetings, paper discussions will occur in-person. The exams are in-person.

Spring 2023 Sections

Section Time Room Professor Email
32070 M/W 5-6:50PM OHE 540 Sanjay Madhav madhav@usc.edu

Office Hours

See the schedule here.

Course Description

Students will learn about practical applications of techniques used to develop a programming language compiler. Topics covered include how to parse the program’s text, represent the program in memory, optimize the code, and generate machine code. Throughout the semester, students will implement components of a working compiler for a subset of C called University Simple C, which was created specifically for this course. This compiler is implemented in C++. Students will also use the extremely popular and industry-standard LLVM framework for many aspects of the compiler.

Learning Objectives

  • Gain a fundamental understanding of how compilers work, focusing on optimization and the back end
  • Implement several aspects of a working compiler for a C programming language subset
  • Work with and write code inside an existing large-scale code base (the LLVM library)
  • Learn how to read, comprehend, and analyze research papers in the field

Prerequisite

CSCI 104L or ITP 365. Junior standing or higher recommended.

Exams

There are two in-person exams in the course:

  • Midterm Exam on 2/22 during your regular class period
  • Final Exam (cumulative; written) with the date/time depending on your section (schedule)

Textbook

Cooper, Keith and Linda Torczon. Engineering a Compiler (Second Edition). Morgan Kaufman. 2012. ISBN-10: 012088478X.

PDFs of the papers discussed in class will be provided.

Description and Assessment of Assignments

There are six different C++ programming assignments in this course, and students will have two or three weeks per programming assignment. The assignments are as follows:

  1. Recursive descent parser
  2. Semantics and Symbol Table Generation
  3. Generation of LLVM IR
  4. Static Single Assignment form
  5. Optimization passes
  6. Register allocation via graph coloring

Programming assignments each have a suite of unit tests. Student grades are based on the percentage of unit tests the assignment passes.

There are also five short problem sets assigned in between these programming assignments. These problem sets both reinforce concepts and help prepare for the exam.

Additionally, we will read 6 papers during the semester. Students will be required to answer a handful of questions prior to the start of the “Paper Discussion” class meetings. During these meetings, students will break into small groups and work through a worksheet in their group as well as participate in larger course discussions.


Table of contents