CS406+CS316: Compilers (Theory + Lab)
Spring 2022 (off-campus based instruction)
Live / Online sessions only - Mondays (11:30AM - 12:30PM), Wednesdays(10:30AM - 11:30AM), Fridays(8:30AM - 9:30AM) (live, online sessions.)
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:
Vivek Shahare, Bonthu Vyuhita
{212011006, 212011001} '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 (3/1 -7/1): Syllabus, Course Overview, Structure of a Compiler; Slides
- Week 2 (10/1-14/1): Economy of Programming Languages, Scanners; Slides
- Week 3 (17/1-21/1): Parsers (CFGs, Error Handling); Slides
- Week 4 (24/1, 28/1): Parsers(Top-Down, Bottom-up); Slides
- Week 5 (31/1 - 4/2): Parsers(CFSM, LR(0), SLR(1)), Semantic Analysis; Slides
- Week 6 (7/2 - 11/2): Semantic Analysis and IR; Slides
- Week 7 (14/2 - 18/2): Semantic Analysis (branching constructs), Midsem Review; Slides
- Week 8: Mid-semester examination week. No classes.
- Week 9 (28/2 - 4/3): Functions, Activation Records, Local Optimizations; Slides
- Week 10 (7/3 - 11/3): Register Allocation, Instruction Scheduling, Control Flow Graphs; Slides
- Week 11 (14/3 - 18/3): Loop Optimization, Dataflow Analysis - Liveness; Slides
- Week 12 (21/3 and 25/3 (no class on 23/3)): Dataflow Analysis - Constant Propagation, Exercise problems Slides
- Week 13 (28/3 and 1/4): More Dataflow Analysis, Register Allocation Slides Global register allocation (slides from Prof. Andrew Myers):Slides
- Week 14 (4/4 - 8/4): Register Allocation using K-Coloring (example), Higher-level loop optimizations Slides Loop dependence analysis (slides from Prof. Milind Kulkarni)Slides, Review for Finals
- Week 15 (11/4 and 13/4): Review for FinalsSlides, sample code for GDBDemo
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: 21/1/2022. Tools overview
- Homework assignment 1 (CS406): Regular Expressions, Automata, Tries, CFG CS406HA1. Due: 1/2/2022
- Programming assignment 2 (CS316): Parsers PA2. Due: 8/2/2022
- Programming assignment 3 (CS316): Symbol Tables PA3, Handout. Due: 27/2/2022
- Mid-term exam (CS406): Exam Due: 1PM, 25/2/2022
- Programming assignment 4 (CS316): Code generation (expressions, assign stmt, IF) PA4. Due: 14/3/2022
- Homework assignment 2 (CS406): Function call management, register allocation, instruction scheduling CS406HA2. Due: 18/3/2022
- Homework assignment 3 (CS406): Local optimizations (loops, CSE), CFGs, dataflow analysis (liveness, constant propagation) CS406HA3. Due: 3/4/2022 (was earlier 30/3)
- Programming assignment 5 (CS316): Code generation (FOR loop with BREAK and CONTINUE statements) PA5. Due: 3/4/2022 (was earlier 31/3)
- Programming assignment 6 (CS316): Code generation (Functions) PA6. Due: 11/4/2022
- Programming assignment 7 (CS316): Register Allocation (Global optimization) PA7. Due: 17/4/2022