Assignment 3: Code optimization

In this third assignment we will have al closer look at the high-level optimizations performed on an application. You get an image enhancement application which we will try to optimize using different techniques. Again, this assignment is split into three parts (Part 3a, Part 3b, and Part 3c).

Part 3a: Manual optimization

In this part we analyze the target application and manually change the code so that it makes more efficient use of the processor. You will use perf to gather program statistics, apply several loop transformations, and manually vectorize a key part of the code using intrinsics. The goal here is to gain some understanding in the possibilities and difficulties of optimizing a high-performance image processing algorithm on a given processor architecture.

Part 3b: Guiding the compiler to the right answer

With our new knowledge of which optimizations are possible for this application we now start again with the original version and try to convince the compiler to apply them by itself. We introduce the compiler's optimization reports and show how these can be utilized to find out why the compiler hasn't been able to optimize your program yet and provide hints to the compiler to further improve the optimization results.

Part 3c: Optimization in the Polyhedral model

Again, starting with a clean slate we now analyze the compiler capabilities if we enable optimizations in the Polyhedral domain using Polly. We investigate the kinds of optimizations that are available and find some of the current limitations of the tools.