ECE 59500 - Introduction to Compilers II: Code Generation


This is a 5-week course for fully online students. On-campus student will take ECE 57300.

Course Details

Lecture Hours: 3 Credits: 1

Counts as:

Normally Offered:

Each Fall


Online only

Requisites by Topic:

Must have completed the first course in this series, Introduction to Compilers, Compiler Basics. Comfort with programming, especially data structures and recursion. Experience with object-oriented programming is also beneficial.

Catalog Description:

This course covers advanced compiler topics: generating code for functions, performing type checking to avoid bugs, performing basic compiler optimizations, and performing register allocation. We will cover the theoretical basis of many of these optimizations as well as how they are implemented in compilers. Students will extend the basic compiler constructed in the first course in this series, Compiler Basics, to add these advanced features to their compiler that translates C code into RISC-V assembly.

Required Text(s):


Recommended Text(s):

  1. Engineering a Compiler , Second Edition , Cooper, Keith, Linda Torczon , Safari, an O'Reilly Media Company , 2011

Learning Outcomes:

A student who successfully fulfills the course requirements will have demonstrated an ability to:
  1. Explain regular expressions and lexing procedures. [None]
  2. Explain context-free grammars and LL(1) parsing. [None]
  3. Explain semantic actions and AST construction. [None]
  4. Explain how to translate ASTs into executable code. [None]
  5. Build a basic compiler that can translate a program into executable code. [None]

Lecture Outline:

1 Topic
1 Functions
2 Compiling functions
3 Type checking
4 Type checking in compilers
5 Optimization: Peephole
6 Optimization: Common subexpression elimination
7 Optimization: Dead code elimination
8 Local register allocation
9 Global register allocation

Assessment Method:

Problem sets, programming assignments, final exam. (11/2021)