U NIVERSITY OF D ELAWARE C OMPUTER & I NFORMATION S CIENCES D EPARTMENT Optimizing Compilers CISC 673 Spring 2011 Course Overview John Cavazos University.

Slides:



Advertisements
Similar presentations
Code Optimization and Performance Chapter 5 CS 105 Tour of the Black Holes of Computing.
Advertisements

U NIVERSITY OF D ELAWARE C OMPUTER & I NFORMATION S CIENCES D EPARTMENT Optimizing Compilers CISC 673 Spring 2009 Instruction Scheduling John Cavazos University.
Compilation 2011 Static Analysis Johnni Winther Michael I. Schwartzbach Aarhus University.
ECE 454 Computer Systems Programming Compiler and Optimization (I) Ding Yuan ECE Dept., University of Toronto
U NIVERSITY OF D ELAWARE C OMPUTER & I NFORMATION S CIENCES D EPARTMENT Optimizing Compilers CISC 673 Spring 2009 Potential Languages of the Future Chapel,
U NIVERSITY OF D ELAWARE C OMPUTER & I NFORMATION S CIENCES D EPARTMENT Optimizing Compilers CISC 673 Spring 2011 More Control Flow John Cavazos University.
Advanced Compiler Design CSE 231 Instructor: Sorin Lerner.
Components of representation Control dependencies: sequencing of operations –evaluation of if & then –side-effects of statements occur in right order Data.
U NIVERSITY OF D ELAWARE C OMPUTER & I NFORMATION S CIENCES D EPARTMENT Optimizing Compilers CISC 673 Spring 2009 Static Single Assignment John Cavazos.
Program Representations. Representing programs Goals.
U NIVERSITY OF D ELAWARE C OMPUTER & I NFORMATION S CIENCES D EPARTMENT Mitigating the Compiler Optimization Phase- Ordering Problem using Machine Learning.
School of EECS, Peking University “Advanced Compiler Techniques” (Fall 2011) Lecture 1: Course Introduction Guo, Yao.
Greg MorrisettFall  Compilers.  (duh)  Translating one programming language into another.  Also interpreters.  Translating and running a language.
Recap from last time We were trying to do Common Subexpression Elimination Compute expressions that are available at each program point.
Representing programs Goals. Representing programs Primary goals –analysis is easy and effective just a few cases to handle directly link related things.
Cpeg421-08S/final-review1 Course Review Tom St. John.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts, Amherst Advanced Compilers CMPSCI 710.
CS 536 Spring Intermediate Code. Local Optimizations. Lecture 22.
Administrative info Subscribe to the class mailing list –instructions are on the class web page, click on “Course Syllabus” –if you don’t subscribe by.
Advanced Compilers CSE 231 Instructor: Sorin Lerner.
Advanced Compilers CSE 231 Instructor: Sorin Lerner.
Advanced Compilers CSE 231 Instructor: Sorin Lerner.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts, Amherst Advanced Compilers CMPSCI 710.
U NIVERSITY OF M ASSACHUSETTS, A MHERST D EPARTMENT OF C OMPUTER S CIENCE Emery Berger University of Massachusetts, Amherst Advanced Compilers CMPSCI 710.
CSCE 312 Computer Organization Lecture 0: Course Administration EJ Kim Department of Computer Science and Engineering 338B Bright
Lecture 1CS 380C 1 380C Last Time –Course organization –Read Backus et al. Announcements –Hadi lab Q&A Wed 1-2 in Painter 5.38N –UT Texas Learning Center:
Introduction & Overview CS4533 from Cooper & Torczon.
Register Allocation and Spilling via Graph Coloring G. J. Chaitin IBM Research, 1982.
Precision Going back to constant prop, in what cases would we lose precision?
Overview of the Course. Critical Facts Welcome to CISC 672 — Advanced Compiler Construction Instructor: Dr. John Cavazos Office.
U NIVERSITY OF D ELAWARE C OMPUTER & I NFORMATION S CIENCES D EPARTMENT Optimizing Compilers CISC 673 Spring 2009 Dynamic Compilation II John Cavazos University.
Flex Compiler Compiler Case Study By Mee Ka Chang.
Overview of the Course Copyright 2003, Keith D. Cooper, Ken Kennedy & Linda Torczon, all rights reserved. Students enrolled in Comp 412 at Rice University.
Overview of the Course Copyright 2003, Keith D. Cooper, Ken Kennedy & Linda Torczon, all rights reserved. Students enrolled in Comp 412 at Rice University.
Department of Computer Science A Static Program Analyzer to increase software reuse Ramakrishnan Venkitaraman and Gopal Gupta.
Compiler course 1. Introduction. Outline Scope of the course Disciplines involved in it Abstract view for a compiler Front-end and back-end tasks Modules.
CSCI 51 Introduction to Computer Science Dr. Joshua Stough January 20, 2009.
U NIVERSITY OF D ELAWARE C OMPUTER & I NFORMATION S CIENCES D EPARTMENT Optimizing Compilers CISC 673 Spring 2009 Register Allocation John Cavazos University.
CISC Machine Learning for Solving Systems Problems John Cavazos Dept of Computer & Information Sciences University of Delaware
Guiding Principles. Goals First we must agree on the goals. Several (non-exclusive) choices – Want every CS major to be educated in performance including.
Data Structures (Second Part) Lecture 1 Bong-Soo Sohn Assistant Professor School of Computer Science and Engineering Chung-Ang University.
Introduction to Data Structures
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Advanced Compilers CMPSCI 710 Spring 2004 Lecture 1 Emery Berger University of Massachusetts,
COP4020 Programming Languages Names, Scopes, and Bindings Prof. Xin Yuan.
U NIVERSITY OF D ELAWARE C OMPUTER & I NFORMATION S CIENCES D EPARTMENT Optimizing Compilers CISC 673 Spring 2011 Dependence Analysis and Loop Transformations.
U NIVERSITY OF D ELAWARE C OMPUTER & I NFORMATION S CIENCES D EPARTMENT Optimizing Compilers CISC 673 Spring 2009 Static Single Assignment John Cavazos.
CISC Machine Learning for Solving Systems Problems John Cavazos Dept of Computer & Information Sciences University of Delaware
Synopsys University Courseware Copyright © 2012 Synopsys, Inc. All rights reserved. Compiler Optimization and Code Generation Lecture - 1 Developed By:
University of Amsterdam Computer Systems – optimizing program performance Arnoud Visser 1 Computer Systems Optimizing program performance.
U NIVERSITY OF D ELAWARE C OMPUTER & I NFORMATION S CIENCES D EPARTMENT Optimizing Compilers CISC 673 Spring 2009 Overview of Compilers and JikesRVM John.
U NIVERSITY OF D ELAWARE C OMPUTER & I NFORMATION S CIENCES D EPARTMENT Optimizing Compilers CISC 673 Spring 2009 Dynamic Compilation I John Cavazos University.
Compiler Optimizations ECE 454 Computer Systems Programming Topics: The Role of the Compiler Common Compiler (Automatic) Code Optimizations Cristiana Amza.
U NIVERSITY OF D ELAWARE C OMPUTER & I NFORMATION S CIENCES D EPARTMENT Intelligent Compilation John Cavazos Computer & Information Sciences Department.
U NIVERSITY OF D ELAWARE C OMPUTER & I NFORMATION S CIENCES D EPARTMENT Optimizing Compilers CISC 673 Spring 2009 Method Profiling John Cavazos University.
Memory-Aware Compilation Philip Sweany 10/20/2011.
Course topics Representing programs Analyzing and transforming programs Applications of these techniques.
U NIVERSITY OF D ELAWARE C OMPUTER & I NFORMATION S CIENCES D EPARTMENT Optimizing Compilers CISC 673 Spring 2011 Data flow analysis John Cavazos University.
U NIVERSITY OF D ELAWARE C OMPUTER & I NFORMATION S CIENCES D EPARTMENT Optimizing Compilers CISC 673 Spring 2011 Yet More Data flow analysis John Cavazos.
Code Optimization.
Advanced Compiler Design
Component 1.6.
Advanced Compilers CMPSCI 710 Spring 2003 Lecture 1
Overview of the Course Copyright 2003, Keith D. Cooper, Ken Kennedy & Linda Torczon, all rights reserved. Students enrolled in Comp 412 at Rice University.
C Programming Lecture 1 : Introduction
C Programming Lecture 1 : Introduction
Advanced Compiler Design
Optimizing Compilers CISC 673 Spring 2009 Course Overview
CSCE156: Introduction to Computer Science II
Presentation transcript:

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

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

U NIVERSITY OF D ELAWARE Computer & Information Sciences Department 3 Overview Class format: Participatory & interactive You take notes, read book & papers Course website:

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

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

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.

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!)

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

U NIVERSITY OF D ELAWARE Computer & Information Sciences Department 9 Why Compilers Matter

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

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…

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…

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!

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

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)!)

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)

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)

U NIVERSITY OF D ELAWARE Computer & Information Sciences Department 18 About You