Compiler Construction

Fall 2026 Edition

This class examines the design and implementation of an optimizing compiler. Students will learn about common optimizations, intermediate languages, and design choices in lectures. Students will learn about the software engineering challenges of implementing a compiler for an imperative, object-oriented language in machine problems. 
 

The class is in-person, and there won't be an online component.  If we have to meet online for some reason, we will announce it in advance. We will be using this Zoom link in such cases.

 

News  

  • 08/06/2026: CampusWire is up! Please sign up at this link. We will be using CampusWire for discussions. Students are encouraged to ask questions using CampusWire to get clarifications from the course staff.

  • 08/06/2026: The website is up!

 Lectures:
 Tuesday/Thursday
 9:30am-10:45am
 0216 Siebel Center for CS

 Instructor:
 Charith Mendis
 Assistant Professor
 Computer Science, UIUC
 4118 Siebel Center  charithm@illinois.edu
 Office hours: Thurs after the   class

 Teaching Assistant:
 Damitha Lenadora
 PhD Student
 Computer Science, UIUC
 damitha2@illinois.edu
 Office hours: Wed 2-3 pm

LLM Usage Policy   

We will allow using tools like ChatGPT, GPT-4, Copilot and similar to assist you while programming in a limited capacity. Today's computing world evolves and these tools will enter the development cycle sooner or later. However, a fair warning: those tools are just tools and can both help and hurt your work. You will be fully responsible for the correctness of the code. Currently, it is unlikely that these tools can generate fully (or even mostly) accurate code. The necessity for you to do systematic testing will increase, and debugging time and cost may exceed those if you were writing the code by hand from scratch.

Note 1: If you plan to use LLMs in your MPs, you need to complete Module 6 of this course. You need to show the badge of completion to the TA.

Note 2: You will have to keep tracks of the logs of the conversations with tools and submit them with each machine project for which you used these tools. The prompts can be in PDF or text format. As prompt engineering is emerging as a discipline, you will be among the first to try to systematically use it in your project.

Note 3: The most effective way to use the LLMs will be to ask small questions and combine and modify the responoses to fit your goal. You may also take a look at how experienced programmers use Copilot in this study. On the other hand, we disallow the prompts that are not about technical content, but are leaning toward cheating (e.g., "Show me the last year's solution to UIUC CS 426 MP1 on Github"). Such uses are not permitted in this class and will fall under the cheating policy.

Note 4: We reserve the right to disallow using these tools for specific projects if we identify that their use will not serve the educational goals. In such cases, we will make this constraint clear at the time we publish the problem description. As the tools constantly evolve, it is difficult to predict their behavior in several weeks or months from now.

Using LLM-based development tools will not be an excuse for identical project codes and other major similarities that would be qualified as plagiarism. Even with the tools' help there will be a need for significant editing of the projects that will very likely result in a unique project code. The teaching staff will also do their tests on the extent to which some of these tools generate usable code. In the case there is a doubt of cheating (see the policy), your detailed logs of prompts may be helpful.


Overview  

Students will complete four machine problems throughout the course. Students who take the 4-unit version of the course also have to complete a fifth machine problem. There will also be two quizzes -- at the mid-semester and at the end (in-person) and ~15 mini-quizzes during selected classes. Details will be discussed during the first class. Each machine problem will build on the previous one, so it is expected that students will write maintainable, reusable, and well-documented code for assignments. The course will be similar in content (and partially in presentation) to the Fall 2025 version.

We will compute the final grade using the following table: 

The core programming project will be in four parts, and will be graded as the semester progresses. The project weights  are 15 (MP1), 25 (MP2), 30 (MP3), and 30 (MP4) out of total project points.
Activity Grade 3-credit Grade 4-credit Details
Programming Assignments (MPs 1-4) 40% 34% The core programming project will be in four parts, and will be graded as the semester progresses. The project weights are 15 (MP1), 25 (MP2), 30 (MP3), and 30 (MP4) out of total project points.
Unit Project (MP5) 0% 15% Only 4-credit-hour students do the unit project. It is mandatory for their grade.
In-class Mini-quizzes 10% 8.5% Mostly MCQ / short answer style question at the start of selected classes (~15 in total, top 10 considered for your grade)
Mid-term Quiz 20% 17% Quiz during lecture. Tentative Date: TBD
Final Quiz 30% 25.5% During final day of classes
Extra Credit 10% 10% We will give additional assignments on the projects (they will together scale up to 10% of the total grade).


We will assign the letter grade based on their number of points on a 100-point scale (i.e. we don't do prior grading-on-the-curve).

More details about the course administration and grading policies are available here.

 

Tentative Schedule  

 
Date Topic Notes
08/25

Introduction

Slides
08/27

Review of Lexing and Parsing


09/01

Review of Parsing


09/03

Parsing, Tesing and Intermediate Representations

MP1 out

09/08

Intermediate Representations 1


09/10

Intermediate Representations 2


09/15

Intermediate Representations 3


09/17

Intermediate Code Generation 1

MP1 deadline, MP2 is out.

09/22

Intermediate Code Generation 2


09/24

Runtime Environments 1


09/29

Runtime Environments 2


10/01

More on Code Generation


10/06

More on Code Generation

Virtual Lecture (OOPSLA)
10/08

No Class (PI Meeting)

MP2 deadline, MP3 out



10/13

More on Code Generation


10/15

Optimization Basics


10/20

Optimization Basics


10/22

Miderm Quiz (In-class)


10/27

Dataflow Analysis

MP5 out

10/29

Dataflow Analysis

Virtual Lecture (PI Meeting)
11/03

Register Allocation


11/05

Register Allocation


11/10

Instruction Scheduling

MP3 deadline, MP4 out

11/12

Guest Lecture (TBD)


11/17

Instruction Scheduling


11/19

Procedure-level Optimization


11/24
Fall Break (no class)
11/26
12/01

Procedure-level Optimization


12/03

Machine Learning for Compilers (ML4C)

MP4 deadline

12/08

Compilers for Machine Learning (C4ML)

MP5 deadline

12/15

Final Exam (Last day of classes)


 

Topics  

  • Lexing and Parsing Review
  • Intermediate Program Representations (AST, CFG, 3-address code, SSA)
  • Runtime Environment
  • Code Generation (imperative fragment, object oriented fragment)
  • Register Allocation
  • Instruction Scheduling
  • Program Optimization (Local, Dataflow, Global)-