Syllabus

Overview:

This is a basic course in compiler construction. You will learn how to write a compiler with a special emphasis on code optimizations.

Course Topics:

Compilation of imperative programming languages :
Language constructs and their compilation
The architecture of the P machine
Assignments and expressions
Space requirments
Identifying equal sub-trees (linear complexity)
Conditional and iterative statements, sequences of statements
Memory allocation for variables of simple type
Memory allocation for static arrays
Memory allocation for dynamic arrays
Memory allocation for records
Pointers and dynamic memory allocation
Procedures
Nesting levels
Passing parameters by-var / by-value
Variable of type function
Formats of machine description
List scheduling

Intermediate optimizations using data flow analysis :
Algebraic simplifications
Constant propagation
Copy propagation
Dead-code elimination
Strength reduction
Invariant code motion of Loop
. Common subexpression elimination
. Inserting assignment in IF-THEN-ELSE statements
. Load-store elimination
. Efficient array references in loops
. Loop unrolling
. Minimizing number of allocated registers
. Using parallel instructions

Machine-dependent code optimizations :
Abstract and real machines
Classification of architectures (VLIW)
Ways of representing architectures
Instruction scheduling/List scheduling

Parsing and lexical analysis :
Becoming familiar with software tools like Flex and Bison

Most of the topics will be covered but not all of them.

Text Books:

by Alfred V. Aho (Author), Monica S. Lam (Author), Ravi Sethi (Author), Jeffrey D. Ullman (Author)
"Compilers: Principles, Techniques and Tools (2nd Edition)" , Addison Wesley; 2 edition (August 31, 2006)

R. Wilhelm and D. Maurer - "Compiler Design", Addison-Wesley, 1995 (We will mainly study chap. 2,12)