Skip to content

rovka/llvm-pass-skeleton

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This repo started as the code support for a workshop that we organized at the KTH School of Information and Communication Technology in Stockholm in December 2017.

The purpose of the workshop was to introduce people to the LLVM IR and middle end (the target-independent optimizer). We assumed no previous knowledge about the LLVM IR or the LLVM APIs. We tried to keep it simple and focus on the basic concepts that would allow people to write a pass that understands and transforms the IR. We did not cover complex topics such as pass management internals, def-use chains, using existing analysis passes etc, but we think the materials here are enough to get someone started.

We used a virtual machine for the workshop. You can reproduce that setup by following these instructions.

You can find the tasks for the workshop and an LLVM cheatsheet in the doc directory. You will also find some slides that we have used to explain a few points about LLVM IR as well as the LLVM API.

Most of the (new) material in this repo has been authored by Diana Picus and Roberto Castañeda Lozano.

Special thanks to Adrian Sampson, whose excellent tutorial we have used as a starting point. Note that we have updated the original code to work with LLVM 5.0.

Original README (Adrian Sampson):

llvm-pass-skeleton

A completely useless LLVM pass. It's for LLVM 3.8.

Build:

$ cd llvm-pass-skeleton
$ mkdir build
$ cd build
$ cmake ..
$ make
$ cd ..

Run:

$ clang -Xclang -load -Xclang build/skeleton/libSkeletonPass.* something.c

Releases

No releases published

Packages

No packages published

Languages

  • C++ 63.8%
  • CMake 28.0%
  • C 8.2%