

















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Project; Professor: Mahlke; Class: Advanced Compilers; Subject: Electrical Engineering And Computer Science; University: University of Michigan - Ann Arbor; Term: Fall 2004;
Typology: Study Guides, Projects, Research
1 / 25
This page cannot be seen from the preview
Don't miss anything!


















Y
» [email protected] » Office - 2223 EECS » Office hours - TBD Y
» Yuan Lin – [email protected] » Office hrs – Will be announced next week » Office hrs will be held in the media union » Primary contact for project/coding questions
Y
» Good C++ programmer (essential) » Linux, gcc, gdb, emacs, cvs, stl » Compiler system not ported to Windows or Mac Y
» EECS 370 » RISC architecture, pipelining, registers, assembly code Y
» EECS 376 » Finite automata, regular expressions, context-free grammars
Y Class textbook » Compilers: Principles, Techniques ,^ and Tools , Aho, Sethi, Ullman (aka red dragon book) Y Other useful books » Lex & Yacc , Levine, Mason and Brown » Advanced Compiler Design & Implementation , Steven Muchnick » Building an Optimizing Compiler , Robert Morgan » Modern Compiler Implementation in Java , Andrew Appel Y Course webpage + course newsgroup » Will be set up next week » Newsgroup – umich.eecs.class. y GSI will regularly check this and answer questions y Read regularly, read before asking new questions
Y
» Learn by doing – Writing code » Substantial amount of programming y Learning curve for MIRV » Reasonable amount of reading Y
» Attendance – You should be here » Print out lecture notes beforehand – notes incomplete » Lots of examples to work out in class
Y
» No preset distribution of grades, scale, etc. » Most (hopefully all) will get A’s and B’s » Projects are essential part of class Y
» Exams (2) – 40% (20% each) » Projects (4) – 55% (10%, 12.5%, 12.5%, 20%) » Homeworks – Practice problems only » Class participation and involvement – 5%
Y
» Not sure how many yet » Optional – not to be turned in Y
» Learn the important concepts » Practice questions for the exams
Y
Preprocessing, parsing, syntax check
Building syntax trees
Creating assembly code
Analysis and optimization of assembly code Y
P1-3: Spec of what you need to do » P4: You have to define and decide what to do y Goal is to create the fastest code possible » P1 done individually » P2-4: groups of 2-3 people
Y
» Be here and don’t just stare at the wall » Be prepared to discuss the material Y
» Solving class problems » Posting insights on the newsgroup » Feedback to me about the class Y
» But it will have an affect, particularly in the borderline cases
Week Subject Reading Projects Exams 0: 9/ Introduction Ch 1 1: 9/13, 9/ Lexical analysis Ch 2- P1 out, 9/ 2: 9/20, 9/ Syntax analysis Ch 4- 3: 9/27, 9/ Syntax analysis Ch 4- P1 due, 9/ 4: 10/4, 10/ Syntax analysisMIRV / Semantic Ch 4-5Ch 6 P2 out, 10/ 5: 10/11, 10/ Semantic analysis Ch 6 6: 10/18, 10/ Semantic analysis Ch 6 P2 due, 10/ 7: 10/25, 10/ Exam reviewExam 1 E1, 10/ 8: 11/1, 11/ Intermediate code Ch 7- P3 out, 11/ 9: 11/8, 11/ Control flow Ch 9 – 10: 11/15,11/ Dataflow and Opti Ch 9- P3 due, 11/ 11: 11/22,11/ Dataflow and Opti Ch 9- P4 out, 11/ 12: 11/29, 12/ Code generation Ch 9- 13: 12/6, 12/ Code gen, reviewExam 2 Ch 9- E2, 12/ 14: 12/ Advanced topics 15: 12/17,12/ P4 demos P4 due
Y Source language » Fortran, Pascal, C, C++ » Verilog, VHDL, Tex, Html Y Target language » Machine code, assembly » High-level languages, simply actions Y Compile time vs run time » Compile time or statically – Positioning of variables » Run time or dynamically – SP values, heap allocation Translator Loader, Linkerand Run-time System Output ObjectProgram SourceProgram
Lexical Analysis Syntax Analysis Semantic Analysis Controlflow/Dataflow Optimization Code Generation Scanner Parser Build high-level IRHigh-level IR to low-level IR conversion Machine independent asm to machine dependent Front end Back end Source Program Context Symbol Table CFG Assembly Code
Y
» Hand-coded ones are faster » But tedious to write, and error prone! Y
» Given a specification of regular expressions » Generate a table driven FSA » Output is a C program that you compile to produce your scanner
Y
» Framework for subsequent semantic processing » Implemented as a push down automaton (PDA) Y
» Hand coded, recursive descent? » Table driven (top-down or bottom-up) » For any non-trivial language, writing a correct parser is a challenge Y
» Given a context free grammar » Generate a parser for that language (again a C program)