EJCP 2017: Research in Compilers and Introduction to Loop Transformations
Tomofumi Yuki (CR Inria)
Overview
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.
Course Outline
Part I: Compiler Research
- What is a Compiler?
- Compiler Research
- Examples of Compiler Research Topics
Slides: pptx,
pdf
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
Slides: pptx,
pdf
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 Instructions
Lab Material
Slides: pptx,
pdf
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.
-
Install VirtualBox
https://www.virtualbox.org/wiki/Downloads
-
Get Ubuntu ISO image
http://www.ubuntu.com/download/desktop
-
Mount the Ubuntu image to a virtual drive
(Microsoft has one if you don't have virtual drives:
http://www.microsoft.com/en-gb/download/details.aspx?id=38780)
-
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