Program Analysis
Program Representations
Interprocedural Analysis/Optimizations
Pointer Analysis
Constraint-based analyses
Compilers: Principles, Techniques, and Tools, by Aho, Sethi, and Ullman, Addison-Wesley PPT SLIDES
Course Title: Advanced Compiler Design
Branch: Computer science and Engineering
Text Books Required:
Compilers: Principles, Techniques, and Tools, by Aho, Sethi, and Ullman, Addison-Wesley,
Course Description:
Download Slides here:
Course Description:
Download Slides here:
Topic | Chapter | |
1. | Organization. Overview of Compilation. l1 | 1, 2 |
2. | Lexical Analysis: Regular Expression & Definitions l3, l4 | 3.1-3.3 |
3. | Lexical Analysis: RE<->NFA<->DFA l4, l5, Javacc 1 2 3 4 5 6 7 8 9 10 | 3.4-3.6 |
4. | Grammars, Recursive Descent Parsing. l6, l7 | 4.4 |
5. | LL Parsing. l8, l9 | 4.4 |
6. | Bottom-up Parsing, l10 | 4.5 |
7. | LR Parsers, l11 | 4.7 |
8. | Item set construction, 1 2 3 4 SLR, LR, LALR, l12 | 4.7 |
9. | Attributes, l16, l17 | 4.9 |
10. | Syntax-Directed Translation, l15, att | 5.1 |
11. | Symbol Tables, l13, st | 7.6 |
12. | Name Resolution, l14, l15 | |
13. | Abstract Syntax Trees l18, ast | 5.2 |
16. | Review for Mid-Term Exam | |
16. | Types: type checking expressions and operations l19 | 6.1, 6.2 |
17. | Types & Equivalences l20 TypeChecking.ppt | 6.3, 6.4 |
18. | Types in OO-languages: method resolution l21 | 6.5 |
19. | Intermediate code generation: languages, expressions l22, l24 | 8.1-8.4 |
20. | Runtime storage organization l23, pCall | 7.2, 7.3 |
21. | Intermediate code generation: statements. Optimizations l25, l26 | 8.4-8.7, 9.4 |
22. | Control-Flow Analysis CFA): blocks, flow-graphs, loops l27.5-9.ppt, | 9.4,10.1,10.4 |
23. | CFA: l28.15-24.ppt | |
24. | Data-Flow Analysis (DFA): l29.25-34.ppt | |
25. | DFA: dags, bbOpt. Global DFA:paths, reaching defs, struct Progs, p35-47.ppt | |
Advanced Compiler Design and Implementation,Morgan Kaufmann PDF NOTES
Branch: Computer science and Engineering
Text Books Required:
- Steven Muchnick, Advanced Compiler Design & Implementation, Morgan Kaufmann, August 1997.
- Keith Cooper and Linda Torczon, Engineering a Compiler, Morgan Kaufmann, October 2003.
Course Description:
Download Slides here:
Num | Topics Covered | Read |
1 | Introduction to Optimizing Compilers | Slides; Ch. 1; Ch. 8.1,8.2,8.4 |
2 | The HiPE Compiler: An Overview | Slides; Paper 1 |
3 | Foundations of Data-Flow Analysis Introduction to Abstract Interpretation | Slides; Ch. 7.1-7.5,8.1-8.5 |
4 | Using Dataflow Analysis for Global Optimization | Slides; Ch. 9.1,9.2 |
5 | Static Single Assignment Form | Slides; Ch. 8.11; Ch. 9.3 |
6 | SSA-based Dead Code Elimination & Sparse Conditional Constant Propagation | Slides; Ch. 12.6; Ch. 10.3,10.4.1 |
7 | Loop Optimizations | Slides; Ch. 13.2, 14.1 |
8 | Global Register Allocation | Slides; Ch. 16; Ch. 13.1-13.5 |
9 | Code Scheduling | Slides; Ch. 17.1-17.5; Ch. 12 |
10 | Compiler Development & Testing | |
11 | Automatic Memory Management (1) | Slides; Paper 2 |
12 | Automatic Memory Management (2) | see slides of previous lecture |
13 | Functional Programming Implementation: Some Issues | Slides |
14 | Virtual Machines and Interpretation Techniques | Slides; Paper 3 |
15 | Just-In-Time and Dynamic Compilation | Slides; Paper 4 |
Compiler Construction
Instructor : Hal Perkins
Textbook : Modern Compiler Implementation in Java by Andrew Appel
- Overview (ppt, pdf); regular expressions and scanners (ppt, pdf).
- Grammars (ppt, pdf); LR parsing (ppt, pdf)
- LR parser construction (ppt, pdf)
- LL parsing (ppt, pdf); intermediate representations (ppt, pdf); abstract syntax trees and visitors (ppt, pdf)
- Visitors (concl.); Static semantics (incl. symbol tables and types) (ppt, pdf);
- . (Election Day!) Static semantics (concl); x86 overview (ppt, pdf)
- Code shape I (statements) (ppt, pdf); Running MiniJava (ppt, pdf);
(Thursday) Exam 6:30 - 8:00 or so. - Code shape II (objects and method dispatch) (ppt, pdf); Instruction selection (ppt, pdf);
- Instruction scheduling (ppt, pdf); Register allocation (ppt, pdf)
- Optimization overview (ppt, pdf); Dataflow analysis (ppt, pdf); Optimization transformations (ppt, pdf)
Compiler Construction
Instructor: Hal Perkins
Texts :
There are three good, recent compiler textbooks available, none of which clearly dominates the others. Lectures and course materials will draw on all three (among other sources). The current edition of the Dragon Book was picked as the "recommended" text for the course, since it seems to have the best overall balance of material, but any of these books would have been suitable as the choice, and you can use any of them that you'd like:- Compilers: Principles, Techniques, & Tools, Aho, Lam, Sethi, & Ullman (Addison-Wesley, 2nd ed., 2007). The "Dragon Book". This is the updated edition of the classic compiler textbook. The coverage of grammars, parsing and optimization is very strong (and has the best theoretical treatment - well beyond what we will do); but the material on semantics and type checking is mixed up with intermediate code generation (something we will deal with), and there is very little about SSA representations of programs (which we'll only touch on lightly). If you already have a copy of the first edition, that will be fine for this course.
- Modern Compiler Implementation in Java, Appel (Cambridge University Press, 2nd edition, 2002). This book is oriented around a mini-java project that is the basis of our course project, but it has some idiosyncrasies because of the author's background in compilers for functional languages. Probably the most succinct of the three books, and we have used it successfully as the text for this course in the past.
- Engineering a Compiler, Cooper and Torczon (Morgan-Kaufman, 2004). This book is particularly good on the design tradeoffs needed to build real compilers. Lecture organization and examples will follow this book to some extent. This is currently used as the textbook in the undergrad compiler course (CSE 401), so used copies might be more readily available.
|
Lecture
Slides
Here are links to the PDF and
PowerPoint lecture slides.
|
Audio
and Video Archives
On the day after the lecture,
video archives will be posted here. If you are running Windows, we recommend
that you install WebViewer. WebViewer permits viewing of
specially prepared Windows Media live streams and archives with instructor
slides and Tablet PC annotations. To use the WebViewer archives, install,
then click on links in the WebViewer column below.
Lecture
|
Video Archive
|
||||
Windows Media
|
MP4
|
Video with slides instead of talking head
(for mobile devices) |
WebViewer
|
Download WebViewer Archive
|
|
Lecture 1: Overview, Administrivia, Languages, Automata,
Regular Expressions
|
|||||
Lecture 2: Parsing & Context-Free Grammars, LR
Parsing, LR Parser Construction
|
|||||
Lecture 3: LL and Recursive-Descent Parsing,
Intermediate Representations, and Implementing ASTs
|
|||||
Lecture 4: Static Semantics, x86 Lite for Compiler
Writers, Code Shape: Basic Constructs, Objects & Classes
|
|||||
Lecture 5: Code Shape II –Objects & Classes, Running
MiniJava - Basic Code Generation and Bootstrapping, Instruction Selection
|
|||||
Lecture 6: Instruction Selection, Instruction
Scheduling, Register Allocation, Introduction to Optimization
|
|||||
Lecture 7: Introduction to Optimization, Dataflow
Analysis, Optimizing Transformations
|
|||||
Lecture 8: Analysis & Optimizations & Loops
|
|||||
Lecture 9: SSA, Exam Topics
|
|||||
Lecture 10: Java Implementation –JVMs, JITs etc., Memory
Management & Garbage Collection, Logistics
|
Compiler Construction
Instructor : David Notkin
Textbook : Engineering a Compiler Cooper and Torczon ,
Download slides from here
(lexing)
(semantic)
(error handling) (final topics)
Introduction to Compiler Construction
Instructor : Hal Perkins
Textbook : Introduction to Compiler Construction
Download slides from here
1. Course introduction. slides
S1. no section
2. Intro & history (concl.)
3. Regular expressions and scanners (intro). Read ch. 1, secs. 2.1-2.4. slides
4. Scanners (concl.)
S2. Project, scanners and regular expressions
5. Intro to parsing. Read sec. 3.1-3.2. slides
6. LR (bottom-up) parsing start. Read sec. 3.4. slides
7. LR parsing (cont.)
S3. Parsing
8. LR parsing (concl.);
9. LR conflicts and table construction. Read Sec. 3.5 and computation of First and Follow sets in Sec. 3.3.4. slides
10. LR construction extended example
S4. First/follow sets, parsers
11. IRs slides; AST and visitor pattern slides
12. AST and visitor pattern slides;
13. Visitor pattern (damage control from Monday); LL parsing & recursive descent. slides
S5. No sections this week.
14. LL grammars and parsing
15. Static semantics and type checking slides
16. Attribute gramars; symbol tables (cont.)
16. Midterm review
18. Types, semantics wrapup.
19. x86 overview slides
21. x86 function calling conventions
22 Code shape I - basic constructs. slides
S7. No sections today - Football Thursday. Extra office hours in lab during section times.
23. Code shape
24. Code shape II - objects and dynamic dispatch slides
25. Class canceled - snow happened in Seattle
X. No section or lecture. Many turkeys meet their demise.
26. Running minijava - project details slides
27. Running minijava; Backend overview slides
S8. Project, misc. topics.
28. Instruction selection and scheduling
29. Register allocation by graph coloring
30. Optimization survey slides
S9. Wrapup and review
32. Compiling dynamic langauges slides
Compiler Optimisation
Lecture Notes
- Lecture Note 1 (PDF)
- Lecture Note 2 (PDF) Description of coursework
- Lecture Note 3 (PDF)
- Lecture Note 4 (PDF)
- Lecture Note 5 (PDF)
- Lecture Note 6 (PDF)
- Additional Lecture Material: Register Allocation (PDF)
- Lecture Note 7 (PDF)
- Lecture Note 8 (PDF)
- Lecture Note 9 (PDF)
- Lecture Note 10 (PDF) Description of coursework part 2
- Lecture Note 11 (PDF)
- Lecture Note 12 (PDF)
- Lecture Note 13 (PDF)
- Lecture Note 14 (PDF)
- Lecture Note 15 (PDF)
- Lecture Note 16 (PDF)
The following are powerpoint slides (and associated code) from the lectures.
Lecture 1- Introduction, class information, first problems.
- Power Point Slides
- Code from the notes
- More on ML, function definition and patterns
- Power Point Slides
- Code from the notes
- Answers to Assignment #2. Review pattern matching, recursion, and use of let for local variables. Librearies, References, While Loops, Accumulating parameter functions. Regular Expressions as programs. RE to NFA
- Power Point Slides
- Code from the notes
- Representing sets as lists, the cross product of two sets, epsilon transitions, epsilon - closure, Interpreting an NFA, NFA to DFA
- Power Point Slides
- Code from the notes
- NFAs, NFAs to DFAs, the subsect construction, Lexical generators, SML-Lex.
- Power Point Slides
- Code from the notes
- More about SML-Lex, The compiler manager, More about library functions over lists (map,filter,find,exists,foldr).
- Power Point Slides
- Code from the notes
- Grammars, Top down parsing, Transition Diagrams, Ambiguity, Left recursion, Refactoring by adding levels, Recursive descent parsing, Predictive Parsers, First and Follow, Parsing tables.
- Power Point Slides
- Code from the notes
- Shift-reduce parsing, Shift-reduce and reduce-reduce conflicts, Precedence parsing, LR parser , LR parsers and FSAs, LR parsing Tables, Sets of Items construction.
- Power Point Slides
- A data structure for grammars, Computing Nullable and First in SML. Possoible Exam Questions.
- Power Point Slides
- Code from the notes
- Modified sets of item construction, Rules for building LR parse tables, The Action rules, The GOTO rules, Conflicts and ambiguity, Shift-reduce and reduce-reduce conflicts, Parser generators and ambiguity, Ambiguous expression grammar, Ambiguous if-then-else grammar, Ml-yacc.
- Power Point Slides
- A directory of Ambiguous Examples in ml-yacc.
- ml-Yacc, Actions when reducing, Making ml-yacc work with ml-lex, Boiler plate.
- Power Point Slides
- Basic Types, Constructed Types, Representing types as data, Describing type systems as rules, Type rules for ML, Type equality,Type coercions, Sub typing. Purpose of type systems, Kinds of type systems, Primitive types, Constructed types, Type checking, Attribute grammars, Inherited attributes, Synthesized attributes, Adding attributes to trees, Programs for computing attribute computations.
- Power Point Slides
- Finish the discussion of Lecture 12 slides.
- Power Point Slides
- Writing type-checkers in ML, Role of type rules, Representing types, Representing programs, Handling errors, Guessing types, Declarations, Let expressions .
- Power Point Slides
- Code from the notes.
- Judgments for mini-Java, Multiple type environments, Class Hierarchy, Setting up an ML typechecker for mini-Java, Subtyping, Rules for Java, Declarations as functions over environments.
- Power Point Slides
- Mutual Recursion, Symbol Tables, Class Hierarchies, Type checkers that rebuild code.
- Power Point Slides
- Code from the notes for mini-ML examples.
- Code from the notes fro mini-Java examples.
- Procedure Abstraction, Name Spaces, Scoping Rules, Activation Records, Object Oriented Languages, Parameter Passing, Returning Values.
- Power Point Slides
- Syntax directed translations, Meanings of programs, Rules for writing a compiler, Intermediate code Pascal-like language Run-time environments Calling sequence Variable references.
- Power Point Slides
- Code from the notes.
- Additional notes to be posted here as lectures are given.
- Pascal-like language Run-time environments Calling sequence Variable references.
- Power Point Slides
- Code from the notes.
- Displays, Memory Layout, Heap Allocation, Garbage Collection, Translating Mini Java.
- Power Point Slides
Optimizing Compilers
Professor John Cavazos
Lecture (Tenative Outline) Slides Papers / Resources / Notes
2/10 Course Overview | Slides (PPT) | |
2/12 Overview of Compilers and JikesRVM | Slides (PPT) | Read Compiler Wikipedia Page and JikesRVM (formerly known as Jalapeno) Paper. |
2/17 Control Flow and Project Ideas | Slides (PPT) | Read the following Wikipedia pages (section) Graph Theory (Basics) Basic Blocks Control Flow Graphs |
2/19 More Control Flow | Slides (PPT) | Read the following Wikipedia page (section) Graph Theory (Dominance) |
2/24 Overview of JikesRVM, Phase I, and Data Flow | TA Slides (PPT) Slides (PPT) | T.J. Marlowe and B.G. Ryder Properties of Data Flow Frameworks, pp. 121-163, ACTA Informatica, 28, 1990. Paper Here |
2/26 Data Flow | Slides (PPT) | Engineering a Compiler, Chapter 8, Sections 8.3, 8.4, 8.6 |
3/03 More Data Flow | Slides (PPT) | Compilers: Principles, Techniques, & Tools. 2nd edition (Dragon Book), Chapter 9, Sections 9.2,9.3, 9.4 |
3/05 Yet More Data Flow and Intelligent Compilation | Slides (PPT) Slides (PPT) | Compilers: Principles, Techniques, & Tools. 2nd edition (Dragon Book), Chapter 9, Sections 9.2,9.3, 9.4 and Intelligent Compilation Paper |
3/10 ILP, Memory, and Syncronization | Slides (PPT) | Guest Lecture: Joseph Manzano |
3/12 Optimization Tradeoffs | Slides (PDF) | Guest Lecture: Xiaoming Li |
3/17 Static Single Assignment I | Slides (PPT) | Efficiently computing static single assignment form and the control dependence graph, Cytron et al. Paper Here |
3/19 Static Single Assignment II | Slides (PPT) | Engineering a Compiler, Chap. 9 (Sections on SSA) |
3/24 Midterm | ||
4/7 Dynamic Compilation I | Slides (PPT) | Adaptive optimization in the Jalapeno JVM, Arnold et al. Paper HERE |
4/9 Dynamic Compilation II | Slides (PPT) | Adaptive optimization in the Jalapeno JVM, Arnold et al. Paper HERE |
4/14 Method Profiling | Slides (PPT) | |
4/16 Feedback Directed Compilation | Slides (PPT) | |
4/21 Register Allocation I | Slides (PPT) | Read the following Wikipedia pages (section) Register Allocation |
4/23 Register Allocation II | Slides (PPT) | Advanced Compiler Design and Implementation, by Stephen Muchnick (pgs 482-486, 494-520) |
4/28 Instruction Scheduling I | Slides (PPT) | Read the following Wikipedia pages (section) Instruction Scheduling |
4/30 Class Cancelled | ||
5/5 Instruction Scheduling II | Slides (PPT) | Read the following Wikipedia pages (section) Instruction Scheduling |
5/7 Loop Transformations I | Slides (PPT) | Read the following Wikipedia pages (section) Loop Optimizations |
5/12 Loop Transformations II | Slides (PPT) | Read the following Wikipedia pages (section) Loop Optimizations |
5/14 ETI Architecture and Compiler | ||
5/18 Future Parallel Languages | Slides (PPT) |
Download Slides here:
- Introduction
- Lexical Analysis
- Parsing #1
- Parsing #2
- Abstract Syntax
- Semantic Analysis
- Run-time Storage Organization
- Intermediate Representation
- Instruction Selection
- Liveness Analysis and Register Allocation
- Storage Allocation
- Functional Languages and Higher-Order Functions
Compiler Design
Lecture Notes- Set 1
- Set 2
- Set 3
- Set 4
- Set 5
- Set 6
- Set 7
- Set 8
- Set 9
- Set 10
- Set 11
- Set 12: Parsing Summary
- Set 13
- Set 14
- Set 15
- Set 16
- Set 17
- Set 18
- Set 19
- Set 20
- Set 21
- Set 22
- Set 23
- Set 24
- Set 25: Monotone Data Flow
- Course Introduction PDF
- Overview of Compiler PDF
- Lexical Analysis PDF
- Add'l Lexical Analysis Notes PDF
- Context-Free Grammars and Parsing PDF
- Syntax-directed translation PDF
- Types PDF
- Type Checking PDF TXT
- Evaluation and Runtime Environments PDF
- Exceptions, memory management PDF
- Intermediate code generation PDF
- Optimization and Program analysis PDF
- Machine code generation PDF
- Review/Summary PDF
Programming Languages
and Compilers
Download :
Class
|
Topic
|
Lecture slides (pdf)
|
1
|
Introduction to course; intro to OCaml
| |
2
|
Ocaml - tuples and lists
| |
3
|
OCaml - type definitions, abstract syntax
| |
4
|
Language implementation overview
| |
5
|
Lexical analysis
| |
6
|
Regular expressions, Ocamllex
| |
7
|
Parsing - context-free grammars, recursive descent parsing
| |
8
|
Top-down parsing
| |
9
|
Bottom-up (shift/reduce) parsing
| |
10
|
LR parsing - conflict resolution
| |
Review for midterm 1 (optional)
| ||
Midterm 1 - 180 Bevier Hall, 7-8:30PM
| ||
11
|
Code generation
| |
12
|
Code generation (cont.)
| |
13
|
Garbage collection; run-time systems for dynamic languages
| |
14
|
History of programming languages
| |
15
|
APL
| |
16
|
Functional programming: higher-order functions
| |
17
|
More higher-order functions
| |
Spring break
| ||
18
|
Even more higher-order functions
| |
19
|
Functional programming in o-o languages
| |
20
|
Review for midterm 2 (optional)
| |
Midterm 2 - 151 Everitt Lab, 7-8:30PM
| ||
21
|
Inference systems; formalizing operational semantics
| |
22
|
Type systems
| |
23
|
Operational semantics
| |
24
|
Hoare logic for imperative languages
| |
25
|
Hoare logic for imperative languages
| |
26
|
Advanced topics: Lazy evaluation; lambda-calculus
| |
27
|
Advanced topics: functional programming for parallelism
| |
28
|
Wrap-up; review for final; preview of follow-up courses
|
For review:sp08-final.pdf(solution) - see below.
And Spring 08 sample questions(solutions) - see below. And slides fromvideotaped problem session |
No comments:
Post a Comment