Teaching

Dr. Cooper’s primary teaching responsibilities are the undergraduate compiler course (COMP 412), a graduate course on program analysis and optimization (COMP 512), and a compiler-construction course focused on the needs of our professional master’s students (COMP 506).

Over the course of his career, he has also taught introductory programming (a functional programming course in Scheme), computer organization, introductory software engineering, and a course in concepts of Computer Science for non-majors (from David Harel’s excellent book “Algorithmics”).

Compiler Construction for Undergraduates

The undergraduate compiler course covers select topics in the construction of programming language translators, including: scanning, parsing, semantic elaboration, instruction selection, instruction scheduling, register allocation, and some simple techniques for code optimization. The course includes three programming assignments: a register allocator for straight-line code, an LL(1) parser generator, and an instruction scheduler for straight-line code.

The lectures and assignments are described in detail on the course web site. The course is taught from Engineering a Compiler, 2nd edition. It covers, roughly, chapters one through seven, parts of eight, and eleven through thirteen.

Advanced Compiler Construction

Advanced Compiler Construction covers a variety of topics that arise in the design and implementation of an optimizing compiler. The emphasis is on scalar analysis and optimization; optimization for parallel hardware (SIMD, multi-threaded, or multiprocessor) is covered in another course. The first couple of weeks cover classic data flow analysis and the translation of code into and out of static single assignment form. That material is followed by a lengthy series of individual transformations. (The selection of transformations varies from year to year. See the course web site for a typical selection.)

The course project varies from year to year, depending on the class size, the availability of teaching assistants, and the interests of the professor and the students. We have built specific optimizations (in a number of different frameworks including LLVM and our own MSCP), multi-pass standalone optimizers for ILOC, tools that convert into and out of static single assignment form, and global register allocators. Material for lectures and the programming projects come from both Engineering a Compiler, 2nd edition (chapters 8, 9, 10, 12, and 13) and a large collection of published and unpublished papers.

Compiler Construction for Graduate Students

As part of our Professional Masters program in Computer Science, we offer a compiler construction course tailored to the needs and backgrounds of those students. This course, which is not generally available to undergraduates, does a quick tour through parsing and generation of intermediate code, then dives more deeply into optimization and code generation than does the undergraduate course. Along the way, in includes several lectures that cover background material not in the undergraduate course, including a lecture on how the memory hierarchy of a modern processor works and how it affects performance, and a lecture on what happens between the time the compiler emits code and execution starts: assemblers, linkers, and loaders.

The project for this course is a simple compiler for a small language, from scanner and parser to generating code for an ILOC virtual machine. The course web site provides lecture notes and the project materials from the most recent semester. Again, this course is taught from Engineering a Compiler, 2nd edition.

Comments are closed.