Download presentation
Presentation is loading. Please wait.
Published byJasper Bishop Modified over 9 years ago
1
U NIVERSITY OF D ELAWARE C OMPUTER & I NFORMATION S CIENCES D EPARTMENT Optimizing Compilers CISC 673 Spring 2011 Course Overview John Cavazos University of Delaware
2
U NIVERSITY OF D ELAWARE Computer & Information Sciences Department 2 About Me John Cavazos Assistant Professor, CIS Research Applying machine learning to hard systems problems Compiling for advanced architectures Interplay between compiler and architecture Nitty-gritty things that happen in compiler back-ends Rethinking fundamental structure of optimizing compilers
3
U NIVERSITY OF D ELAWARE Computer & Information Sciences Department 3 Overview Class format: Participatory & interactive You take notes, read book & papers Course website: www.cis.udel.edu/~cavazos/cisc673/
4
U NIVERSITY OF D ELAWARE Computer & Information Sciences Department 4 Overview Grades: 5%class participation 40%exams 55%project Materials: Selected papers Compilers books on reserve in library
5
U NIVERSITY OF D ELAWARE Computer & Information Sciences Department 5 Project Stuff 1 to 2 person teams Implement optimization/analysis in: JikesRVM (IBM’s research Java compiler) Other compilers subject to my approval
6
U NIVERSITY OF D ELAWARE Computer & Information Sciences Department 6 Project Stuff Due dates (roughly) 02/22/11: Half-page project description. 03/08/11:2-4 page project design. 04/12/11:Project implementation review. 05/03/11: Implementation due. 05/12-17/11: In-class presentations. 05/17/11:Project report.
7
U NIVERSITY OF D ELAWARE Computer & Information Sciences Department 7 Class Topics Some bread & butter analyses & optimizations Control flow Data flow analysis & implementation Loop Transformations SSA form Register allocation Instruction scheduling Pointer analysis Runtime systems (compiler must be aware of these!)
8
U NIVERSITY OF D ELAWARE Computer & Information Sciences Department 8 Class Topics Advanced topics (TBD) Autotuning Optimizations for Parallel Programs Program slicing Error detection Run time system interaction
9
U NIVERSITY OF D ELAWARE Computer & Information Sciences Department 9 Why Compilers Matter
10
U NIVERSITY OF D ELAWARE Computer & Information Sciences Department 10 What are Compilers, Anyway? Compiler: translates program in one language to executable program in other language Typically lowers abstraction level E.g., Java/C++ to assembler Optimizing compiler: Misnomer! Optimal compilation intractable Improves program performance
11
U NIVERSITY OF D ELAWARE Computer & Information Sciences Department 11 Compilers Don’t Help Much Do compilers improve performance anyway? Proebsting’s law (Todd Proebsting, Microsoft Research): Difference between optimizing and non-optimizing compiler ~ 4x Assume compiler technology represents 36 years of progress (actually more) Compilers double program performance every 18 years! Not quite Moore’s Law…
12
U NIVERSITY OF D ELAWARE Computer & Information Sciences Department 12 Argumentum Ad Absurdum Compilers don’t help much (Proebsting’s Law) Don’t use optimizer Hmmm…
13
U NIVERSITY OF D ELAWARE Computer & Information Sciences Department 13 A Big BUT But: people will not accept massive performance hit for these gains Compile with optimization! Still use C and C++!! Hand-optimize their code!!! Even write assembler code (gasp)!!!! Apparently performance does matter… Multicores makes compilers even MORE important!
14
U NIVERSITY OF D ELAWARE Computer & Information Sciences Department 14 Why Compilers Matter Key part of compiler’s job: make the costs of abstraction reasonable Remove performance penalty for: Using objects Safety checks (e.g., array-bounds) Writing clean code (e.g., recursion) Use program analysis to transform code: primary topic of this course
15
U NIVERSITY OF D ELAWARE Computer & Information Sciences Department 15 Analysis & The Holy Grail Other great uses for program analysis: Static error-checking Detect information leaks Avoid security holes Informing runtime system (e.g., GC) Even better optimizations! E.g., locality-improving transformations (“memory wall”) Holy Grail for compiler research: Programmer:writes simple but O(2^n) algorithm Compiler: changes it to O(n log n) (or O(1)!)
16
U NIVERSITY OF D ELAWARE Computer & Information Sciences Department 16 Levels of Analysis (in order of increasing detail & complexity) Local (single-block) [1960’s] Straight-line code Simple to analyze; limited impact Intraprocedural [1970’s – today] Whole procedure Dataflow & dependence analysis Interprocedural [late 1970’s – today] Whole-program analysis Tricky: Very time and space intensive Hard for some PL’s (e.g., Java)
17
U NIVERSITY OF D ELAWARE Computer & Information Sciences Department 17 Optimization = Analysis + Transformation Key analyses: Control-flow if-statements, branches, loops, procedure calls Data-flow definitions and uses of variables Representations: Control-flow graph Control-dependence graph Def/use, use/def chains SSA (Static Single Assignment)
18
U NIVERSITY OF D ELAWARE Computer & Information Sciences Department 18 About You
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.