Course topics Representing programs Analyzing and transforming programs Applications of these techniques.

Slides:



Advertisements
Similar presentations
Software & Services Group, Developer Products Division Copyright© 2010, Intel Corporation. All rights reserved. *Other brands and names are the property.
Advertisements

Control-Flow Graphs & Dataflow Analysis CS153: Compilers Greg Morrisett.
Advanced Compiler Design CSE 231 Instructor: Sorin Lerner.
Object Oriented Programming in Java George Mason University Fall 2011
Program Representations. Representing programs Goals.
Intro to CIT 594
Recap from last time We saw various different issues related to program analysis and program transformations You were not expected to know all of these.
Representing programs Goals. Representing programs Primary goals –analysis is easy and effective just a few cases to handle directly link related things.
Recap from last time We saw various different issues related to program analysis and program transformations You were not expected to know all of these.
Cpeg421-08S/final-review1 Course Review Tom St. John.
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.
Previous finals up on the web page use them as practice problems look at them early.
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2004 Project.
Programming Language Semantics Mooly SagivEran Yahav Schrirber 317Open space html://
Advanced Compilers CSE 231 Instructor: Sorin Lerner.
CS 330 Programming Languages 09 / 06 / 2007 Instructor: Michael Eckmann.
1 Program Analysis Mooly Sagiv Tel Aviv University Textbook: Principles of Program Analysis.
Recap from last time We saw various different issues related to program analysis and program transformations You were not expected to know all of these.
Bellevue University CIS 205: Introduction to Programming Using C++ Lecture 1: Getting Started by George Lamperti & BU Faculty.
Recap from last time: live variables x := 5 y := x + 2 x := x + 1 y := x y...
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:
Direction of analysis Although constraints are not directional, flow functions are All flow functions we have seen so far are in the forward direction.
Program Analysis Mooly Sagiv Tel Aviv University Sunday Scrieber 8 Monday Schrieber.
Recap from last time We saw various different issues related to program analysis and program transformations You were not expected to know all of these.
From last class. The above is Click’s solution (PLDI 95)
Computer Science 102 Data Structures and Algorithms V Fall 2009 Lecture 1: administrative details Professor: Evan Korth New York University 1.
CS1101: Programming Methodology Aaron Tan.
Precision Going back to constant prop, in what cases would we lose precision?
CPSC 388 – Compiler Design and Construction Lecture: MWF 11:00am-12:20pm, Room 106 Colton.
(1.1) COEN 171 Programming Languages Winter 2000 Ron Danielson.
U NIVERSITY OF D ELAWARE C OMPUTER & I NFORMATION S CIENCES D EPARTMENT Optimizing Compilers CISC 673 Spring 2011 Course Overview John Cavazos University.
Chapter 1 Introduction Dr. Frank Lee. 1.1 Why Study Compiler? To write more efficient code in a high-level language To provide solid foundation in parsing.
Computational Methods of Scientific Programming Lecturers Thomas A Herring, Room A, Chris Hill, Room ,
Sadegh Aliakbary Sharif University of Technology Fall 2012.
CS 140 Computer Programming (I) Second semester (3 credits) Imam Mohammad bin Saud Islamic University College of Computer Science and Information.
Guiding Principles. Goals First we must agree on the goals. Several (non-exclusive) choices – Want every CS major to be educated in performance including.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Advanced Compilers CMPSCI 710 Spring 2004 Lecture 1 Emery Berger University of Massachusetts,
CMSC 2021 CMSC 202 Computer Science II for Majors Fall 2002 Mr. Frey (0101 – 0104) Mr. Raouf (0201 – 0204)
Major objective of this course is: Design and analysis of modern algorithms Different variants Accuracy Efficiency Comparing efficiencies Motivation thinking.
Principles of Computer Science I Honors Section Note Set 1 CSE 1341 – H 1.
Static Program Analyses of DSP Software Systems Ramakrishnan Venkitaraman and Gopal Gupta.
1.  10% Assignments/ class participation  10% Pop Quizzes  05% Attendance  25% Mid Term  50% Final Term 2.
Compiler Principles Fall Compiler Principles Lecture 0: Local Optimizations Roman Manevich Ben-Gurion University.
CMP 131 Introduction to Computer Programming Violetta Cavalli-Sforza Week 3, Lecture 1.
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.
An Undergraduate Course on Software Bug Detection Tools and Techniques Eric Larson Seattle University March 3, 2006.
Software Development Problem Analysis and Specification Design Implementation (Coding) Testing, Execution and Debugging Maintenance.
Compiler Construction (CS-636)
Intro to CIT 594
CMSC 2021 CMSC 202 Computer Science II for Majors Spring 2002 Sections Ms. Susan Mitchell.
CMSC 2021 CMSC 202 Computer Science II for Majors Spring 2003 Mr. Frey (0101 – 0104) Mr. Raouf (0201 – 0204)
March 1, 2004CS WPI1 CS 509 Design of Software Systems Lecture #6 Monday, March 1, 2004.
Programming for Performance CS 740 Oct. 4, 2000 Topics How architecture impacts your programs How (and how not) to tune your code.
Data Structures and Algorithms in Java AlaaEddin 2012.
Compiler Construction CPCS302 Dr. Manal Abdulaziz.
FUNCTIONAL PROGRAMING AT WORK - HASKELL AND DOMAIN SPECIFIC LANGUAGES Dr. John Peterson Western State Colorado University.
PROBLEM SOLVING AND PROGRAMMING ISMAIL ABUMUHFOUZ | CS 170.
Computer Science I ISMAIL ABUMUHFOUZ | CS 180. CS 180 Description BRIEF SUMMARY: This course covers a study of the algorithmic approach and the object.
A Single Intermediate Language That Supports Multiple Implemtntation of Exceptions Delvin Defoe Washington University in Saint Louis Department of Computer.
Advanced Compiler Design
Introduction to Compiler Construction
Compiler Construction (CS-636)
Advanced Compilers CMPSCI 710 Spring 2003 Lecture 1
Objective of This Course
Exam Topics Hal Perkins Autumn 2009
Advanced Compiler Design
Optimizing Compilers CISC 673 Spring 2009 Course Overview
Advanced Compiler Design
Presentation transcript:

Course topics Representing programs Analyzing and transforming programs Applications of these techniques

Course topics (more details) Representations –Abstract Syntax Tree –Control Flow Graph –Dataflow Graph –Static Single Assignment –Control Dependence Graph –Program Dependence Graph –Call Graph

Course topics (more details) Analysis/Transformation Algorithms –Dataflow Analysis –Interprocedural analysis –Pointer analysis –Rule-based analyses and transformations –Constraint-based analysis

Course topics (more details) Applications –Scalar optimizations –Loop optimizations –Object oriented optimizations –Program verification –Bug finding

Course pre-requisites No compilers background necessary Some familiarity with lattices –I will review what is necessary in class Familiarity with functional/OO programming –Optimization techniques for these kinds of languages Standard ugrad cs curriculum will likely cover the above –Talk to me if you think you don’t have the pre-requisites

Course work In-class midterm (30%) Take-home final (30%) Course project (40%)

Course project Goal of the project –Get some hands on experience with compilers and/or Get a feel for what research is like in PL Requirements –Groups of 3 –Must have large compiler implementation component Milestones –Project proposal (meet with me, week 2) –Project updates (3 meetings, weeks 4, 6, 8) –Final presentation (end of quarter)

List of sample projects on course page Find bugs in language-implementation Find bugs in applications Code perforation, trading accuracy for power Super-optimization Parallelizing transformations Compiling a DSL

Administrative info Class web page is up – Will post lectures, project info, etc.

Questions?

Program Analyzer Issues (discuss) Program Analyzer InputOutput

Program Analyzer Issues (discuss) Program Analyzer InputOutput

Program Analyzer Issues (discuss) Program Analyzer InputOutput

Input issues Input is a program, but… What language is the program written in? –imperative vs. functional vs. object-oriented? maybe even declarative? –what pointer model does the language use? –reflection, exceptions, continuations? –type system trusted or not? –one often analyzes an intermediate language... how does one design such a language? Instructor’s discussion notes Program Analyzer InputOutput

Input issues How much of the program do we see? –all? –one file at a time? –one library at a time? –reflection… Any additional inputs? –any human help? –profile info? Instructor’s discussion notes Program Analyzer InputOutput

Analysis issues Analysis/compilation model –Separate compilation/analysis quick, but no opportunities for interprocedural analysis –Link-time allows interprocedural and whole program analysis but what about shared precompiled libraries? and what about compile-time? –Run-time best optimization/analysis potential (can even use run-time state as additional information) can handle run-time extensions to the program but severe pressure to limit compilation time –Selective run-time compilation choose what part of compilation to delay until run-time can balance compile-time/benefit tradeoffs Instructor’s discussion notes Program Analyzer InputOutput

Analysis issues Does running-time matter? –for use in IDE? –or in overnight compile? Instructor’s discussion notes Program Analyzer InputOutput

Output issues Form of output varies widely, depending on analysis –alias information –constantness information –loop terminates/does not terminate Correctness of analysis results –depends on what the results are used for –are we attempting to design algorithsm for solving undecidable problems? –notion of approximation –statistical output Instructor’s discussion notes Program Analyzer InputOutput

Program Transformation Issues (discuss) Program Transformer InputOutput

Input issues A program, and … Program analysis results Profile info? Environment: # of CPUs, # of cores/CPU, cache size, etc. Anything else? Instructor’s discussion notes Program Transformer InputOutput

Transformation issues What is profitable? What order to perform transformations? What happens to the program representation? What happens to the computed information? For example alias information? Need to recompute? Instructor’s discussion notes Program Transformer InputOutput

Output issues Output in same IL as input? Should the output program behave the same way as the input program? Instructor’s discussion notes Program Transformer InputOutput