Introduction

The ability to write software that analyzes and transforms code is not only valuable to researchers working in program analysis, optimization, and formal verification but is also valuable to researchers in operating systems and computer architecture. This tutorial will guide attendees through creating extensions to the LLVM compiler that perform simple analysis and transformations. It will also include a brief introduction to the Secure Virtual Architecture (SVA) for those interested in program transformations on operating system kernel code.

Slides

The slides for the tutorial can be found here:

Audience

This tutorial is designed for students and researchers that seek a basic introduction to compiler techniques. No prior experience with program analysis is assumed.

Topics

The tutorial will cover the following topics:
  1. Basic structure of LLVM - This will introduce attendees to the basic structure of the LLVM compiler. Attendees will learn how the compiler is structured as a set of plugins (called “Passes”) each of which performs one simple analysis or transformation of the code.
  2. LLVM Intermediate Representation - This will teach attendees the basic data structures that LLVM uses to represent the code of a program and how to use the LLVM libraries to manipulate these data structures for the purposes of analysis and transformation.
  3. Writing an LLVM pass - Attendees will learn how to write their own plugins to the LLVM compiler and how to get the compiler to load and run their plugins.
  4. Brief introduction to Secure Virtual Architecture - This will teach those working on operating systems about the additional instructions that Secure Virtual Architecture (SVA) adds to the LLVM Intermediate Representation.

Resources