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.

Slides:



Advertisements
Similar presentations
Code Tuning Strategies and Techniques
Advertisements

Runtime Techniques for Efficient and Reliable Program Execution Harry Xu CS 295 Winter 2012.
1 CIS 461 Compiler Design and Construction Fall 2014 Instructor: Hugh McGuire slides derived from Tevfik Bultan, Keith Cooper, and Linda Torczon Lecture-Module.
Write a program step by step. Step 1: Problem definition. Given the coordinate of two points in 2-D space, compute and print their straight distance.
Software & Services Group, Developer Products Division Copyright© 2010, Intel Corporation. All rights reserved. *Other brands and names are the property.
Compilation 2011 Static Analysis Johnni Winther Michael I. Schwartzbach Aarhus University.
Computer Architecture Lecture 7 Compiler Considerations and Optimizations.
Computer Science 2212a/b - UWO1 Structural Testing Motivation The gcov Tool An example using gcov How does gcov do it gcov subtleties Further structural.
Simplified Gated Assignment Surinder Jain Supervisor : Bernhard Scholz Assignment 3 – INFO5993.
Advanced Compiler Design CSE 231 Instructor: Sorin Lerner.
JAVA: An Introduction to Problem Solving & Programming, 6 th Ed. By Walter Savitch ISBN © 2012 Pearson Education, Inc., Upper Saddle River,
JAVA: An Introduction to Problem Solving & Programming, 5 th Ed. By Walter Savitch and Frank Carrano. ISBN © 2008 Pearson Education, Inc., Upper.
Introduction to Programming Lesson 1. Objectives Skills/ConceptsMTA Exam Objectives Understanding Computer Programming Understand computer storage and.
90-723: Data Structures and Algorithms for Information Processing Copyright © 1999, Carnegie Mellon. All Rights Reserved. 1 Lecture 2: Basics Data Structures.
LECTURE 1 CMSC 201. Overview Goal: Problem solving and algorithm development. Learn to program in Python. Algorithm - a set of unambiguous and ordered.
CSE , Autumn 2011 Michael Bond.  Name  Program & year  Where are you coming from?  Research interests  Or what’s something you find interesting?
Using Programmer-Written Compiler Extensions to Catch Security Holes Authors: Ken Ashcraft and Dawson Engler Presented by : Hong Chen CS590F 2/7/2007.
CIS 101: Computer Programming and Problem Solving Lecture 8 Usman Roshan Department of Computer Science NJIT.
Copyright © 2006 The McGraw-Hill Companies, Inc. Programming Languages 2nd edition Tucker and Noonan Chapter 1 Overview A good programming language is.
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.
CS 290C: Formal Models for Web Software Lecture 10: Language Based Modeling and Analysis of Navigation Errors Instructor: Tevfik Bultan.
Recap from last time Saw several examples of optimizations –Constant folding –Constant Prop –Copy Prop –Common Sub-expression Elim –Partial Redundancy.
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.
Administrative info Subscribe to the class mailing list –instructions are on the class web page, which is accessible from my home page, which is accessible.
Advanced Compilers CSE 231 Instructor: Sorin Lerner.
Cse321, Programming Languages and Compilers 1 6/19/2015 Lecture #18, March 14, 2007 Syntax directed translations, Meanings of programs, Rules for writing.
B-1 Lecture 2: Problems, Algorithms, and Programs © 2000 UW CSE University of Washington Computer Programming I.
Previous finals up on the web page use them as practice problems look at them early.
Advanced Compilers CSE 231 Instructor: Sorin Lerner.
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.
Java Review 2 – Errors, Exceptions, Debugging Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
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.
04/25/13 Halting Problem Discrete Structures (CS 173) Derek Hoiem, University of Illinois 1
UNIT 3 TEMPLATE AND EXCEPTION HANDLING. Introduction  Program errors are also referred to as program bugs.  A C program may have one or more of four.
P ARALLEL P ROCESSING I NSTITUTE · F UDAN U NIVERSITY 1.
High level & Low level language High level programming languages are more structured, are closer to spoken language and are more intuitive than low level.
COMPUTER PROGRAMMING Source: Computing Concepts (the I-series) by Haag, Cummings, and Rhea, McGraw-Hill/Irwin, 2002.
Aardvark Anatomy of a Large-Scale Social Search Engine.
Gary MarsdenSlide 1University of Cape Town Principles of programming language design Gary Marsden Semester 2 – 2001.
Sir Tim Berners-Lee (1955-) British computer scientist Inventor of the World Wide Web in 1989 (developed the first HTML protocol and sent the first messages.
Introduction to Java CSIS 3701: Advanced Object Oriented Programming.
Java Virtual Machine Case Study on the Design of JikesRVM.
CSE 425: Data Types I Data and Data Types Data may be more abstract than their representation –E.g., integer (unbounded) vs. 64-bit int (bounded) A language.
Principles of Computer Science I Honors Section Note Set 1 CSE 1341 – H 1.
Research Topics CSC Parallel Computing & Compilers CSC 3990.
JAVA: An Introduction to Problem Solving & Programming, 5 th Ed. By Walter Savitch and Frank Carrano. ISBN © 2008 Pearson Education, Inc., Upper.
CSE S. Tanimoto Paradigms 1 Paradigms Imperative Functional Object-Oriented Rule-Based Logic Visual* Scripting* * whether visual and scripting methodologies.
1. 2 Preface In the time since the 1986 edition of this book, the world of compiler design has changed significantly 3.
CS 460/660 Compiler Construction. Class 01 2 Why Study Compilers? Compilers are important – –Responsible for many aspects of system performance Compilers.
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.
Compiler Optimizations ECE 454 Computer Systems Programming Topics: The Role of the Compiler Common Compiler (Automatic) Code Optimizations Cristiana Amza.
The single most important skill for a computer programmer is problem solving Problem solving means the ability to formulate problems, think creatively.
CMPSC 16 Problem Solving with Computers I Spring 2014 Instructor: Lucas Bang Lecture 11: Pointers.
Announcements You will receive your scores back for Assignment 2 this week. You will have an opportunity to correct your code and resubmit it for partial.
Course topics Representing programs Analyzing and transforming programs Applications of these techniques.
Announcements Assignment 2 Out Today Quiz today - so I need to shut up at 4:25 1.
©SoftMoore ConsultingSlide 1 Code Optimization. ©SoftMoore ConsultingSlide 2 Code Optimization Code generation techniques and transformations that result.
A Single Intermediate Language That Supports Multiple Implemtntation of Exceptions Delvin Defoe Washington University in Saint Louis Department of Computer.
Advanced Compiler Design
Optimization Code Optimization ©SoftMoore Consulting.
Advanced Compiler Design
CMSC 202 Exceptions 2nd Lecture.
Introduction to Programming
Tour of common optimizations
Tour of common optimizations
CMSC 202 Exceptions 2nd Lecture.
Optimizing Compilers CISC 673 Spring 2009 Course Overview
Tour of common optimizations
Presentation transcript:

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 things We will learn more about each one of the topics we touched upon last time

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

Project schedule Find groups a week from today –groups of 2-3 –groups of 1 possible if you ask me Project proposal due the following Tuesday –but... how are we supposed to come up with ideas!!!!

Ideas for generating project ideas If you are currently doing research –that is related to programming languages/compilers –carve out some part of your current research, and do it for the project Think about what annoys you the most –in programming –and fix it using program analysis techniques

Ideas for generating project ideas Think about technology trends –iphone, mobile devices –multicore, parallelism –web browsers, java scripts, etc. –bluetooth, ad-hoc networks –how do these change the way we program/compile? Try to find bugs in real programs using PL techniques –search for “Dawson Engler” and look at some of his papers. Try to use similar techniques to find real bugs.

Ideas for generating project ideas How can I use information that is out there? –ask yourself: what information is out there? And how can I record it/analyze it/use it to improve programmer productivity? –For example: cvs logs, bugzilla, keystrokes, mouse movements, etc. Talk to your neighbor –in the 231 class, that is –have a discussion

Tour of common optimizations

Simple example foo(z) { x := 3 + 6; y := x – 5 return z * y }

Simple example foo(z) { x := 3 + 6; y := x – 5 return z * y }

Another example x := a + b;... y := a + b;

Another example x := a + b;... y := a + b;

Another example if (...) { x := a + b; }... y := a + b;

Another example if (...) { x := a + b; }... y := a + b;

Another example x := y... z := z + x

Another example x := y... z := z + x

Another example x := y... z := z + y What if we run CSE now?

Another example x := y... z := z + y What if we run CSE now?

Another example x := y**z... x :=...

Another example Often used as a clean-up pass x := y**z... x :=... x := y z := z + x x := y z := z + y Copy propDAE x := y z := z + y

Another example if (false) {... }

Another example if (false) {... }

Another example In Java: a = new int [10]; for (index = 0; index < 10; index ++) { a[index] = 100; }

Another example In “lowered” Java: a = new int [10]; for (index = 0; index < 10; index ++) { if (index = a.length()) { throw OutOfBoundsException; } a[index] = 0; }

Another example In “lowered” Java: a = new int [10]; for (index = 0; index < 10; index ++) { if (index = a.length()) { throw OutOfBoundsException; } a[index] = 0; }