FC5264: Introduction to Basic and Advanced Compiler Optimization Techniques

Spring 2014


Instructor: Ramakrishna Upadrasta (U. Ramakrishna)
Email: Ramakrishna AT iith DOT ac DOT in
Office:


Course Description

The objective of this course is to learn basic and advanced compiler optimization techniques, either traditional or modern in their scope, or scalar-variable based or loop-optimization based in their application or machine independent or dependent in their variety.

The initial part of the course would be devoted to a collection of traditional and classic compiler analyses and optimizations that are primarily based on control flow and data flow analyses. This will be followed by studying more high-level optimizations that are based on the static single assignment intermediate representation as well as low-level optimizations like register allocation, instruction scheduling and software pipelining.

The latter part of this course would be devoted to a model named polyhedral compilation where for-loops can be transformed to run efficiently on advanced architectures like multi-core or GPU using rational and integer linear programming techniques. Here, the focus would be on basics of the three phase process of dependence analysis, affine scheduling and code generation.


Lecture Schedule

11-March-2014 Organization, Logistics and Introduction
12-March-2014 Introduction to Compiler Optimizations

Global Sub-Expression Elimination, Copy Propagation,
Loop Invariant Code-Motion, Strength Reduction, Redundancy Elimination,
Unrolling, Inlining, Tail Recursion Removal, Vectorization, Loop Interchange, Loop Blocking

Intro to Optimization by Prof. YN Srikant, IISc (NPTEL)
14-March-2014 Control Flow Analysis(CFA)

Dominators, Back Edges, Natural Loops, Interval analysis, T1-T2 analysis,
Reducibility (using back edges, Interval analysis and T1-T2 analysis).
CFA by Prof. YN Srikant, IISc (NPTEL)
Dominators by Prof. Keshav Pingali (UT Austin)
19-March-2014
&
21-March-2014
Data Flow Analysis (DFA)

DFA schema,
Four classic DFA problems (Reaching Definitions, Available Expressions,
Live Variables, Very Busy Expressions), DU and UD chains

DFA by Prof. YN Srikant, IISc (NPTEL)
DFA by Prof. Uday Khedker (IITB)
28-March-2014 DFA and Optimizations

Optimizations using DFA: Global Common Subexpression Elimination,
Copy Propagation, Loop Invariant Code Motion, Induction variables.
DFA by Prof. YN Srikant, IISc (NPTEL)
DFA optimizations by Prof. YN Srikant, IISc (NPTEL)
DFA Bit Vector Frameworks by Prof. Uday Khedker (IITB)
2nd-April-2014 SSA Form: Introduction and Construction

Introduction and Definition, Join sets and &Phi nodes
Dominators and Dominance Frontiers,
Minimal SSA phi placement (Cytron et al) and variable renaming

SSA introduction by Prof. YN Srikant, IISc (NPTEL)
Dominators by Prof. Keshav Pingali (UT Austin)
SSA construction and optimizations by Prof. Keshav Pingali (UT Austin)
4th-April-2014
&
9th-April-2014
SSA optimizations: Constant Propagation (CP)

Constant propagation optimization,
The CP lattice, Transfer function and meet operators,
Classification of CP algorithms (the three older
algorithms and Wegman-Zadeck algorithm),
Wegman-Zadeck's Conditional Constant Propagation
SSA Constant Propagation by Prof. YN Srikant, IISc (NPTEL)
SSA construction and optimizations by Prof. Keshav Pingali (UT Austin)
11th-April-2014
&
16th-April-2014
Register Allocation

Hardness of problem: exact vs. heuristic solutions
Chaitin's algorithm, Constructing the Interference Graph (IG)
Kempe's heuristic for coloring,
Recent results on chordal graphs
Register Allocation by Prof. YN Srikant, IISc (NPTEL)
Register Allocation by Prof. Keshav Pingali (UT Austin)
Register Allocation from CMU
16th-April-2014 Instruction Scheduling and Software Pipelining

Overview of Insruction Scheduling and Software Pipelining

Instruction Scheduling by Prof. YN Srikant, IISc (NPTEL)
Software Pipelining by Prof. YN Srikant, IISc (NPTEL)
TBD Loop Optimizations
TBD Polyhedral Compilation,
Dependence Analysis
TBD Polyhedral Scheduling (Feautrier)

References


Suggested Papers for Final Presentation

Track 1: Concepts/Algorithms (Depth) Track 2: Survey papers (Breadth) Track 3: Domain Specific Compilation (Applications) and Miscellaneous

Grading

Activity Weight
Class Participation 20%
End Term Exam (Open Book) 40%
Paper Presentation 40%