CS406+CS316: Compilers (Theory + Lab)
Spring 2021 (off-campus based instruction)
Live / Online sessions only - Tuesdays (10:30AM - 11:15AM), Wednesdays (8:30AM to 9:15AM), and Thursdays (9:30AM to 10:15AM)
About the Course
Description:
This course focuses on the principles of compiler design and implementation. Topics include:
- Scanning and parsing: determining the syntactic structure of a program
- Semantic routines: determining the semantics of a program and building intermediate representation
- Code generation: emitting equivalent assembly code for the program
- Optimizations: improving the performance of a program
- Program analysis: determining interesting information about program's behavior
Details:
The course syllabus discusses most of the details of the course, including a tentative schedule of topics, exam dates, and other administrative information. Announcements, assignment links, and discussion will be posted on the GitHub-Teams discussion page. If you have a question about a concept covered in lecture or about a detail of an assignment, check the discussion page first!
Instructor:
Nikhil Hegde
nikhilh 'at' iitdh 'dot' ac 'dot' in
Office hour (doubt clearing session): On demand online sessions based on the availability of student(s) and the instructor
TAs:
Priya Hampannavar, Gayatri Rayar
{priyash, gayatri 'dot' rayar} 'at' iitdh 'dot' ac 'dot' in,
Office hour (doubt clearing session): On demand online sessions based on the availability of student(s) and the TAs
Lecture Schedule and Notes
The slides are based on those designed by Prof. Kulkarni and Prof. Aiken
- Week 1 (5/1 - 7/1): Syllabus, Course Overview, Structure of a Compiler; Slides
- Week 2 (12/1 - 14/1): Lexical Analyzer, Regular Sets, Finite Automata Slides. Flash-cards - 12_1, 13_1 14_1
- Week 3 (19/1 - 21/1): Scanners (implementation), Parsers Slides. Parser_Demo_Files. Flash-cards - 19_1, 20_1, 21_1.
- Week 4 (28/1): Parsers - Top-down parsing and table driven method; Slides
- Week 5 (2/2 - 4/2): Parsers - Top-down parsing (Contd.) and Bottom-up Parsers; Slides
- Week 6 (9/2 - 11/2): Parsers LR(k), Semantic Processing ; Slides
- Week 7: 16/2-(No class), 17/2- Midterm review: (solutions), 18/2-IR code generation: Slides
- Week 9 (2/3 - 4/3): IR Code generation - recap, loops, switch statements, and functions; Slides
- Week 10 (9/3, 10/3): IR Code Generation (Functions), Local Optimizations; Slides
- Week 11 (16/3-18/3): Register Allocation, Instruction Scheduling Slides, Global register allocation (slides from Prof. Andrew Myers):Slides
- Week 12 (23/3 - 25/3): Control flow graphs, Dataflow analysis (liveness) Slides
- Week 13 (30/3 - 1/4): More dataflow analysis Slides
- Week 14 (6/4, 8/4): Dataflow analysis (Recap), Higher-level loop optimizations Slides, Dependence Analysis (slides from Prof. Milind Kulkarni):Slides
- Finals review: slides
Homework Assignments and Exams
All homework assignments are due at 11:59PM unless otherwise announced. Assignment and exam details will be posted during the semester.
- Programming assignment 1 (CS316): GitHub and Git overview, Environment Setup, Makefiles, Scanner PA1. Due: 20/1/2021
- Homework assignment 1 (CS406): Regular Expressions, Automata, Tries CS406HA1. Due: 31/1/2021
- Programming assignment 2 (CS316): Parsers PA2. Due: 3/2/2021
- Programming assignment 3 (CS316): Semantic Routines - I and Symbol Table PA3. Due:
1/3/2021 4/3/2021Slides
- Mid-term exam (CS406) (26/2): Midterm.
- Programming assignment 4 (CS316): Semantic routines (statements - assignments, READ/WRITE, if) PA4. Due:
17/3/2021 19/3/2021
- Homework assignment 2 (CS406): Semantic Routines, Functions, Register Allocation CS406HA2. Solutions Due:
23/3/2021 29/3/2021
- Programming assignment 5 (CS316): For loop and Functions PA5. Due: 31/3/2021
- Programming assignment 6 (CS316): Register allocation PA6.
Due: 11/4/2021 16/4/2021