EJCP 2017: Research in Compilers and Introduction to Loop Transformations
Tomofumi Yuki (CR Inria)
The main goal of this course is to give some ideas about what research in
compiler is about. One of the main challenges in compilers is in analyzing a
program to find what to do with it to bring higher performance. In many cases,
what should be done is obvious to an expert programmer. However, automating the
decision process and the transformations themselves is a whole different story.
Even the word "performance" is context sensitive, and can mean speed, code
size, energy efficiency, and other metrics.
This course aims to illustrate these challenges and some techniques to
addresses the difficulties. The main subject is parallelism and data
locality; traditionally important properties of programs, now
getting more and more important.
Part I: Compiler Research
- What is a Compiler?
- Compiler Research
- Examples of Compiler Research Topics
Here is the code for the permutation example: gemm-permutation-tests.tar
Part II: Compiler Optimizations
- Loop Parallelism and Dependences
- Dependence Tests
- Polyhedral Model
- Locality and Tiling
- Simplifying Reductions
Lab: Introduction to Loop Transformations
The lab will step through an important loop transformation, and expose some of
the challenging in automating it within a compiler.
You will need the following:
- Recent version of gcc (or some other compiler if you know what you are doing)
- Know a bit about C
Lab Objectives and Solutions
If you are going to bring a laptop without Linux/Mac, then I advise you to prepare a virtual machine Linux environment to make things easier.
Get Ubuntu ISO image
Mount the Ubuntu image to a virtual drive
(Microsoft has one if you don't have virtual drives:
Create a new virtual machine using VirtualBox, specifying Ubuntu as
the OS and following parameters:
- 2GB memory
- 8GB disk (use dynamically allocated virtual disk)
Install Ubuntu in the new VM by specifying the virtual drive with the
Ubuntu image as the boot drive
- Ubuntu should come with gcc but you can make sure by:
sudo apt-get install gcc