Assignment 2: Code analysis using LLVM's IR

Moving up into the slightly more abstract layers of the compiler we now visit LLVM's IR. This assignment is also split into parts, this time there are only two (Part 2a and Part 2b).

In this assignment we will focus on application analysis at the IR level. Our goal is to have early information on the available instruction level parallelism so that we have something to base our architecture design decisions upon (rings any bells?).

Part 2a: Creating a custom analysis pass

To get started we'll create a custom analysis pass. This will be done outside of the LLVM source tree as this keeps the code a bit more focussed (there are fewer places where you need to make changes). For our analysis we'll start by computing the worst-case execution time (WCET) and as-soon-as-possible and as-late-as-possible (ASAP/ALAP) execution times of the operations in our program based on a simplified architecture model.

Part 2b: Computing schedule times

The analysis algorithms constructed in the first part of this assignment don't take resource constraints into account yet. In this second part of this assignment we will extend these algorithms to get more realistic performance estimates and some insight on the trade-offs between resource availability and execution time of our program. For this purpose you will first introduce a more complete model of our imaginary processor architecture, implement a list scheduling algorithm for this architecture, and extend the scheduler to work with a mixed set of available resources.