CS243: Program Analysis and Optimization Winter 2012
This page is updated frequently, so check back often. All materials for the course will be posted here.What do we teach?
This course teaches program analysis techniques used in compilers and software development tools to improve productivity, reliability, and security. Emphasis on the methodology of applying mathematical abstractions such as graphs, fixpoint computations and binary decision diagrams to writing complex software, using compilers as an example.
How do you learn this?
This is a course where math and programming meet. Learning compiler techniques has much in common with learning mathematical proofs. You learn by trying, finding your own insights. This means the assignments can take a variable amount of time! We want you to formulate your own variations of problems and solve them.
How is the course structured?
- Highly interactive lectures, textbook reading.
- Written assignments explore mathematical concepts from lectures.
- Programming assignments analyze Java code.
- Problem sessions for discussion.
- Piazza for offline questions.
- Midterm and Final.
Logistics When, where, what and how
| Lectures | Mondays and Wednesdays 11:00am - 12:15 in Gates B01 |
| Problem Session | Fridays 3:15 to 4:05pm in Gates B03 |
| Prerequisites | CS 103 or CS 103B, and CS 107; Java programming language experience |
| Textbook | Compilers: Principles, Techniques, & Tools (Second Edition), Alfred V. Aho, Monica S. Lam, Ravi Sethi, Jeffrey D. Ullman, Addison-Wesley, 2007. |
| Class Q/A Website | CS243 on Piazza - for all questions related to the material |
| Videos of Lectures | SCPD Webcast for Stanford Students |
| Staff Mailing List | cs243-win1112-staff@lists.stanford.edu for administrative questions |
| Midterm | TBA |
| Final | Thursday March 22, 8:30 am - 11:30 am. All local SCPD students must come to campus for the exam. |
| Grade Distribution | Homework: 50%, Midterm: 15%, Final: 35% |
Staff Professor and TA details
IMPORTANT Contact us using the staff mailing list for administrative questions
Monica Lam, Instructor
| Office | Gates 307 |
| Office Hours | Mon 2:30 - 3:30pm, Wed 12:30 - 1:30 pm held in Gates 307 |
| Contact Details | (650) 725-3714 |
Darlene Hadding, Admin
| Office | Gates 408 |
| Phone | (650) 723-1430 |
| darlene at csl.stanford.edu |
David Goldblatt, TA
| Office | None |
| Office Hours | Gates 400, 5-6, Mondays and Tuesdays |
| Contact Details | Staff list |
Niels Joubert, TA
| Office | Gates 386 |
| Office Hours | Gates 400, 5-6, Mondays and Tuesdays |
| Contact Details | Staff list |
Eric Schkufza, TA
| Office | Gates 407 |
| Office Hours | Gates 400, 5-6, Mondays and Tuesdays |
| Contact Details | Staff list |
Tentative Schedule Subject to change
| Date | Topic | Reading | Lecture notes | Assignment out | Assignment due |
|---|---|---|---|---|---|
| Jan 9 [M] | Introduction | 1.1-5, 8.4, 8.5, 9.1 | Lecture 1 Handout, Slides, Example | ||
| Jan 11 [W] | Dataflow Analysis Introduction | 9.2 | Lecture 2 Handout, Slides | ||
| Jan 16 [M] | MLK day, no class | ||||
| Jan 18 [W] | Dataflow Analysis Foundations | 9.3 | Lecture 3 Handout, Slides | HW1 (solutions) | Jan 25 |
| Jan 23 [M] | Constant Propagation, Loops | 9.4, 9.6 | Lecture 4 Handout, Slides | ||
| Jan 25 [W] | Joeq Framework | JoeQ Slides | HW2 | Feb 3 (5p) | |
| Jan 30 [M] | Partial Redundancy Elimination | 9.5 | Lecture 5 Handout, Slides | ||
| Feb 1 [W] | Register Allocation | 8.8 | Lecture 6 Handout, Slides | HW3 (solutions) | Feb 8 (11am) |
| Feb 6 [M] | Scheduling | 10 | Lecture 7 Handout, Slides | ||
| Feb 8 [W] | Scheduling | 10 | Lecture 8 Handout, Slides, Sample Midterm (Solutions) | HW4 | Feb 24 (5pm) |
| Feb 13 [M] | Midterm | ||||
| Feb 15 [W] | Dynamic Compilation | ||||
| Feb 20 [M] | President's Day, no class | ||||
| Feb 22 [W] | Pointer Analysis | 12 | |||
| Feb 27 [M] | BDDs in Pointer Analysis | 12 | |||
| Feb 29 [W] | Parallelization | 11.1-11.1.4 | |||
| Mar 5 [M] | Loop Transforms for Parallelism and Locality | 11.1-11.3, 11.6-11.7.4, 11.9-11.9.6 | |||
| Mar 7 [W] | Garbage Collection | 7.4, 7.5, 7.6 | |||
| Mar 12 [M] | Advanced Garbage Collection | 7.7, 7.8 | |||
| Mar 14 [W] | Research Topics | ||||
| Mar 22 [Th] | Final (8:30 am - 11:30 am) in Gates B1 |
Problem Sessions Fridays 3:15 to 4:05pm, Gates B03
| Date | Problem Session |
|---|---|
| Jan 13 | No discussion section first week |
| Jan 20 | Designing and computing Dataflow analyses |
| Jan 27 | MFP algorithm correctness and the meaning of "safety" |
| Feb 3 | Partial redundancy elimination and more complicated analyses |
Handouts and Graded Assignments What happens with physical materials
Hardcopies of the course material and graded assignments will be distributed during class. Extras and assignments that are not picked up will be placed in the handout bin on the 3rd floor of Gates. Turn left as you come off the elevator and head across the hall to the nook between the two wings. There is a file cabinet with a drawer for CS243.
SCPD students: Please download the lecture notes before the lecture; the material will be available by the morning of the lecture. Your assignments will be returned via the SCPD courier. Since all the material for the assignments will be available on the web, you have to give your assignmnts to the SPCD courier (or hand it in electronically) on the same day as everybody else.
Assignment Policy
Group Work
Homework will consist of both written and programming assignments. You are encouraged to work on the programming assignments in groups of two, but you must do the written assignments by yourself.
Late Policy
In general, no late assignments are accepted. However, you have two grace days for the entire quarter. That means you can be late by one day for two assignments, or use the two days up for one assignment.
Submission
Homework should be submitted in class only. If you do not come to class it should be handed to Darlene Hadding in Gates 408 who will write the date and time of the submission. Late homeworks should also be directed to Darlene. We do not check the file cabinet for homework! SCPD students may submit their homework by e-mail via scpd-distribution@lists.stanford.edu.
Programming assignments will have specific submission instructions included with the handouts. We will use a certain amount of automatic grading to help us deal with the massive amounts of code everyone submits, so please follow the submission instructions exactly as written!
Honor Code Cheating and Plagiarism is a no-no
You are free to discuss the assignment and solutions with others. However, you must write your own assignment, and must not represent any portion of others' work as your own. Anybody violating the honor code will be referred to the Judical-Affairs Office. If convicted, the normal penalty is a quarter suspension or worse.