Simone Campanoni

Associate professor
Department of Computer Science at Northwestern University

Simone Campanoni

Computer Science
Northwestern University

CS 323: Code Analysis and Transformation

Description

Fast, highly sophisticated code analysis and code transformation tools are essential for modern software development. Before releasing its mobile apps, Facebook submits them to a tool called Infer that finds bugs by static analysis, i.e., without even having to run the code, and guides developers in fixing them. Google Chrome and Mozilla Firefox analyze and optimize JavaScript code to make browsers acceptably responsive. Performance-critical systems and application software would be impossible to build and evolve without compilers that derive highly optimized machine code from high-level source code that humans can understand. Understanding what modern code analysis and transformation techniques can and can't do is a prerequisite for research on both software engineering and computer architecture since hardware relies on software to realize its potential. In this class, you will learn the fundamentals of code analysis and transformation, and you will apply them by extending LLVM, a compiler framework now in production use by Apple, Adobe, Intel and other industrial and academic enterprises.

Syllabus
Department page

Material

This class takes materials from three different books (listed in the syllabus) as well as a few research papers. The result is a set of slides, notes, and code. Some lectures rely on code and notes (not slides).
You can download the template to use for your LLVM middle-end passes here.
All the slides used in the 2022-2023 class are below. The rest of the material is available only on Canvas.
Materials are improved every year. They are updated on this website (atomically) only at the end of the class.

Week number First lecture Second lecture
Week 0 Welcome Introduction to LLVM
Week 1 Data Flow Analysis
Week 2 Static Single Assignment form LLVM hacking
Week 3 Data Flow Analysis and their uses Foundations of Data Flow Analysis
Week 4 Control Flow Analysis Dependences
Week 5 Memory alias analysis
Week 6 Inter-procedural CAT
Week 7 Inter-procedural analysis example: VLLPA Loops
Week 8 Loops
Week 9 Loop transformations, State-of-the-art CAT Competition

Hall of Fame

Students extend the industrial-strength compiler clang using their own advanced code analyses and transformations developed during this class. At the end of the class, the resulting compilers compete and the names of the students that designed and built the best compilers are reported below.

Year Name Picture
2022 - 2023 Riley "a11ce" Boksenbaum Hall of fame 2022
2021 - 2022 Peter Zhong, Maxwell Paik Hall of fame 2021
2020 - 2021 Aaron Nelson Hall of fame 2020
2019 - 2020 Gaurav Chaudhary Hall of fame 2019
2018 - 2019 Vijay Kandiah Hall of fame 2018
2017 - 2018 Angelo Matni Hall of fame 2017

External links:
LinkedIn profile LinkedIn Follow SimoneCampanoni on Twitter Twitter GitHub profile GitHub

Share this page with: