CS243: Program Analysis and Optimization Winter 2013
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 | Friday 11:00am - 11:50 in Skilling Aud |
| 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 | for administrative questions |
| Midterm | Feb 11. |
| Final | 8:30am-11:30am March 22 at Gates B01 |
| Grade Distribution | TBA |
Staff Professor and TA details
IMPORTANT Contact us using the staff mailing list for administrative questions
Jeffrey Ullman, Instructor
| Office | Gates 433 |
| Office Hours | By arrangement via |
| Contact Details |
Shih-wei Liao, Instructor
| Office | Gates 407 |
| Office Hours | By arrangement via |
| Contact Details |
John Whaley, Instructor
| Office | Gates 406 |
| Office Hours | By arrangement via |
| Contact Details |
Darlene Hadding, Admin
| Office | Gates 408 |
| Phone | (650) 723-1430 |
Pokey Rule, TA
| Office | Gates B26A |
| Office Hours | Mon 1:00pm-2:00pm Thu 2:00pm-3:00pm |
| Contact Details | Staff list |
Joseph Wen, TA
| Office | Gates B26A |
| Office Hours | Tue 11:00am-12:00pm Wed 4:00pm-5:00pm |
| Contact Details | Staff list |
Keith Siilats, TA
| Office | Gates B28 |
| Office Hours | Wed 1:00pm-2:00pm |
| Contact Details | Staff list |
Tentative Schedule Subject to change
| Date | Topic | Reading | Lecture notes | Assignment out | Assignment due |
|---|---|---|---|---|---|
| Jan 7 [M] | Introduction | 1.1-5, 8.4, 8.5, 9.1 | Lecture 1 Handout, Slides, Example | ||
| Jan 9 [W] | Dataflow Analysis Introduction | 9.2 | Lecture 2 Slides 1 PDF 1 Slides 2 PDF 2 | ||
| Jan 14 [M] | Dataflow Analysis Foundations | 9.3 | Lecture 3 Slides PDF | Gradiance | Jan 21 |
| Jan 16 [W] | Constant Propagation, Loops | 9.4, 9.6 | Lecture 4 Slides PDF | ||
| Jan 21 [M] | MLK day, no class | Gradiance | Jan 28 | ||
| Jan 23 [W] | Constant Propagation, Loops | Lecture 5 Slides PDF | Lab1 | Feb 1 | |
| Jan 28 [M] | Partial Redundancy Elimination | 9.5 | Lecture 6 Slides PDF | ||
| Jan 30 [W] | Register Allocation | 8.8 | Lecture 7 Slides PDF Sample Midtern | Gradiance | Feb 10 |
| Feb 4 [M] | Scheduling | 10 | Lecture 8 Slides PDF | ||
| Feb 6 [W] | Scheduling | 10 | Lecture 9 Slides PDF | Lab2 | Feb 22 |
| Feb 11 [M] | Midterm | Gradiance | Feb 18 | ||
| Feb 13 [W] | Dynamic Compilation | Lecture 10 Handout, Slides | |||
| Feb 18 [M] | President's Day, no class | ||||
| Feb 20 [W] | Pointer Analysis | 12 | Lecture 11 Handout, Slides | ||
| Feb 25 [M] | BDDs in Pointer Analysis | 12 | Lecture 12 Handout, Slides | ||
| Feb 27 [W] | BDDs in Pointer Analysis (cont) | 12 | Lecture 13 Slides | Lab3 | Mar 8 |
| Mar 4 [M] | Parallelization | 11.1-11.1.4 | Lecture 14 Slides | ||
| Mar 6 [W] | Loop Transforms for Parallelism and Locality | 11.1-11.3, 11.6-11.7.4, 11.9-11.9.6 | Lecture 15 Slides | ||
| Mar 11 [M] | Garbage Collection | 7.4, 7.5, 7.6 | Lecture 16 Slides, PDF | ||
| Mar 13 [W] | Advanced Garbage Collection | 7.7, 7.8 | Lecture 16 (cont) |
Problem Sessions Friday 11:00am - 11:50
| Date | Problem Session |
|---|---|
| Jan 11 | No discussion section first week, but Professor Ullman will be holding office hours in his office (Gates 433) from 2:00-3:00pm. |
| Jan 25 | Slides |
Handouts and Graded Assignments What happens with physical materials
CS243 will be using the Gradiance automated homework system for some of the required work. You should open your free account at www.gradiance.com/services and then sign up for the class using the "class token" FA817673.
Gradiance looks like multiple-choice questions, but it is really quite different. You are given problems to work out, just as you would in an ordinary homework. You are then given a multiple-choice question to test whether or not you have the correct solution. If you get a choice wrong, you are given a hint and encouraged to try again. You are allowed to try as many times as you like, and the goal is to get everything right eventually. To avoid repeated guessing on one problem at a time, you need to repeat all the questions each time you submit, and you will be given a different set of choices each time.
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
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!
Written homework should be submitted via Gradiance, as described above. If you have any issues accessing the Gradiance site, please contact the TAs or instructors.
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.