CS323+CS316: Compilers (Theory + Lab)
Spring 2023
Room 23 - Mondays (5:00PM - 5:55PM), Tuesdays (2PM to 2:55PM), and Wednesdays (3:00PM - 3:55PM)
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
TAs:
Bonthu Vyuhita, Deepan Raj
212011001 'at' iitdh 'dot' ac 'dot' in, 222013001 'at' iitdh 'dot' ac 'dot' in
Lecture Schedule and Notes
The slides are based on those designed by Prof. Kulkarni and Prof. Aiken
- Week 1 (2/1 -4/1): Syllabus, Course Overview, Structure of a Compiler; Slides
- Week 2 (9/1 - 11/1): Scanners (concepts and implementation) Slides
- Week 3 (16/1 - 18/1): Parsers (concepts and implementation) Slides; Bison_Quickstart
- Week 4 (23/1 - 25/1): Parsers (concepts contd.) Slides
- Week 5 (30/1 - 1/2): Parsers (conclusion, AST construction), Semantic Processing Slides
- Week 6 (6/2 - 8/2): Semantic Processing (IR code generation) Slides
- Week 7 (13/2 - 15/2): IR code generation for loops, switch statements, functions Slides
- Week 8 : Midsem exam week - no classes
- Week 9 (27/2 - 1/3): Midsem exam (discussion), Functions (Contd), local optimizationSlides
- Week 10 (6/3 - 7/3): Register Allocation, Instruction Scheduling, Control Flow Graphs; Slides
- Week 11 (13/3 - 15/3): Instruction Scheduling (contd), Control Flow Graphs; Slides
- Week 12 20/3: Dr. Santosh Nagarakatte talk: "A case for correctly rounded math libraries", 21/3: Dataflow analysis-liveness Slides
- Week 13 (27/3 - 29/3): Dataflow analysis- symbolic analysis, constant propagation, reaching definition, available expressions Slides
- Week 14 (3/4, 5/4): Global register allocation (slides from Prof. Andrew Myers):Slides
, Loop dependence analysis Slides, (slides from Prof. Milind Kulkarni)Slides
- Week 15 (10/4 - 12/4): Loop dependence analysis (contd. refer to slides posted previous week), in-class assignment on 11/4, student team presentation on LLVM and MLIR on 12/4
Quizzes, 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.
- In-Class Quiz: 10/4
- CS316 Programming assignment 1: GitHub and Git overview, Environment Setup, Makefiles, Scanner PA1. Due: 17/1/2023.
- CS316 Programming assignment 2: Parsers PA2. Due: 31/1/2023
- CS316 Programming assignment 3: Symbol Table PA3;Passing data objects in Flex and Bison. Due: 14/2/2023
- CS323 Assignment 1 and Key Assignment1_Key Held on: 15/2/2023
- Mid-term exam (CS323): Exam 2PM-4PM, 21/2/2023
- Programming assignment 4 (CS316): Code generation (expressions, assign stmt, IF) PA4. Due: 14/3/2023
- Programming assignment 5 (CS316): Code generation (WHILE) PA5. Due: 28/3/2023
- Programming assignment 6 (CS316): Code generation (functions) PA6. Due: 14/4/2023
- CS323 Assignment 2 and Key Assignment2_Key Held on: 11/4/2023
- Programming assignment 7 (CS316): Register Allocation (Global optimization) PA7. Due: 23/4/2023
- Endsem exam (CS323): Exam 2PM-5PM, 18/4/2023