Motivation (Cont d) Motivation (Cont d)

Similar documents
Lecture 4: Parsing. Administrivia

Source code. where each α ij is a terminal or nonterminal symbol. We say that. α 1 α m 1 Bα m+1 α n α 1 α m 1 β 1 β p α m+1 α n

[ ] 1+ lim G( s) 1+ s + s G s s G s Kacc SYSTEM PERFORMANCE. Since. Lecture 10: Steady-state Errors. Steady-state Errors. Then

ECE Spring Prof. David R. Jackson ECE Dept. Notes 6

Section 11.6: Directional Derivatives and the Gradient Vector

NEW APPLICATIONS OF THE ABEL-LIOUVILLE FORMULA

Abstract Interpretation: concrete and abstract semantics

cycle that does not cross any edges (including its own), then it has at least

EECE 301 Signals & Systems Prof. Mark Fowler

Supplementary Materials

priority queue ADT heaps 1

Recall that by Theorems 10.3 and 10.4 together provide us the estimate o(n2 ), S(q) q 9, q=1

The Matrix Exponential

Abstract Interpretation. Lecture 5. Profs. Aiken, Barrett & Dill CS 357 Lecture 5 1

Partial Derivatives: Suppose that z = f(x, y) is a function of two variables.

(1) Then we could wave our hands over this and it would become:

The Matrix Exponential

A Uniform Approach to Three-Valued Semantics for µ-calculus on Abstractions of Hybrid Automata

Basic Polyhedral theory

Addition of angular momentum

Injective topological fibre spaces

Chapter 10. The singular integral Introducing S(n) and J(n)

EEO 401 Digital Signal Processing Prof. Mark Fowler

SECTION where P (cos θ, sin θ) and Q(cos θ, sin θ) are polynomials in cos θ and sin θ, provided Q is never equal to zero.

LESSON 10: THE LAPLACE TRANSFORM

Multiple Short Term Infusion Homework # 5 PHA 5127

BINOMIAL COEFFICIENTS INVOLVING INFINITE POWERS OF PRIMES

Propositional Logic. Combinatorial Problem Solving (CPS) Albert Oliveras Enric Rodríguez-Carbonell. May 17, 2018

Addition of angular momentum

Strongly Connected Components

Function Spaces. a x 3. (Letting x = 1 =)) a(0) + b + c (1) = 0. Row reducing the matrix. b 1. e 4 3. e 9. >: (x = 1 =)) a(0) + b + c (1) = 0

BINOMIAL COEFFICIENTS INVOLVING INFINITE POWERS OF PRIMES. 1. Statement of results

Fourier Transforms and the Wave Equation. Key Mathematics: More Fourier transform theory, especially as applied to solving the wave equation.

Integration Continued. Integration by Parts Solving Definite Integrals: Area Under a Curve Improper Integrals

Section 6.1. Question: 2. Let H be a subgroup of a group G. Then H operates on G by left multiplication. Describe the orbits for this operation.

PROBLEM SET Problem 1.

EEO 401 Digital Signal Processing Prof. Mark Fowler

Y 0. Standing Wave Interference between the incident & reflected waves Standing wave. A string with one end fixed on a wall

SCHUR S THEOREM REU SUMMER 2005

Lecture 37 (Schrödinger Equation) Physics Spring 2018 Douglas Fields

Engineering Differential Equations Practice Final Exam Solutions Fall 2011

10. The Discrete-Time Fourier Transform (DTFT)

Deift/Zhou Steepest descent, Part I

From Elimination to Belief Propagation

First derivative analysis

INTEGRATION BY PARTS

Chapter 6 Folding. Folding

LINEAR DELAY DIFFERENTIAL EQUATION WITH A POSITIVE AND A NEGATIVE TERM

Lenses & Prism Consider light entering a prism At the plane surface perpendicular light is unrefracted Moving from the glass to the slope side light

RELATIONS BETWEEN GABOR TRANSFORMS AND FRACTIONAL FOURIER TRANSFORMS AND THEIR APPLICATIONS FOR SIGNAL PROCESSING

Network Congestion Games

Bifurcation Theory. , a stationary point, depends on the value of α. At certain values

CPSC 665 : An Algorithmist s Toolkit Lecture 4 : 21 Jan Linear Programming

That is, we start with a general matrix: And end with a simpler matrix:

APPLICATIONS OF THE LAPLACE-MELLIN INTEGRAL TRANSFORM TO DIFFERNTIAL EQUATIONS

The Equitable Dominating Graph

Exercise 1. Sketch the graph of the following function. (x 2

MCE503: Modeling and Simulation of Mechatronic Systems Discussion on Bond Graph Sign Conventions for Electrical Systems

Problem Set 6 Solutions

Einstein Equations for Tetrad Fields

ME 321 Kinematics and Dynamics of Machines S. Lambert Winter 2002

u 3 = u 3 (x 1, x 2, x 3 )

The Frequency Response of a Quarter-Wave Matching Network

Lecture 6.4: Galois groups

Data Assimilation 1. Alan O Neill National Centre for Earth Observation UK

Computing and Communications -- Network Coding

Introduction to Arithmetic Geometry Fall 2013 Lecture #20 11/14/2013

ELECTRON-MUON SCATTERING

ANALYSIS IN THE FREQUENCY DOMAIN

Pipe flow friction, small vs. big pipes

Searching Linked Lists. Perfect Skip List. Building a Skip List. Skip List Analysis (1) Assume the list is sorted, but is stored in a linked list.

First order differential equation Linear equation; Method of integrating factors

DISTRIBUTION OF DIFFERENCE BETWEEN INVERSES OF CONSECUTIVE INTEGERS MODULO P

( ) = ( ) ( ) ( ) ( ) τ τ. This is a more complete version of the solutions for assignment 2 courtesy of the course TA

Week 3: Connected Subgraphs

BSc Engineering Sciences A. Y. 2017/18 Written exam of the course Mathematical Analysis 2 August 30, x n, ) n 2

MATH 319, WEEK 15: The Fundamental Matrix, Non-Homogeneous Systems of Differential Equations

On spanning trees and cycles of multicolored point sets with few intersections

Unit 6: Solving Exponential Equations and More

COUNTING TAMELY RAMIFIED EXTENSIONS OF LOCAL FIELDS UP TO ISOMORPHISM

Direct Approach for Discrete Systems One-Dimensional Elements

Basic Logic Review. Rules. Lecture Roadmap Combinational Logic. Textbook References. Basic Logic Gates (2-input versions)

INTRODUCTION TO AUTOMATIC CONTROLS INDEX LAPLACE TRANSFORMS

Some remarks on Kurepa s left factorial

Higher-Order Discrete Calculus Methods

COHORT MBA. Exponential function. MATH review (part2) by Lucian Mitroiu. The LOG and EXP functions. Properties: e e. lim.

ENGR 323 BHW 15 Van Bonn 1/7

1997 AP Calculus AB: Section I, Part A

Figure 1: Closed surface, surface with boundary, or not a surface?

Characterizations of Continuous Distributions by Truncated Moment

DISCRETE TIME FOURIER TRANSFORM (DTFT)

Roadmap. XML Indexing. DataGuide example. DataGuides. Strong DataGuides. Multiple DataGuides for same data. CPS Topics in Database Systems

What is a hereditary algebra?

ON A CONJECTURE OF RYSElt AND MINC

Quantum Phase Operator and Phase States

Derivation of Eigenvalue Matrix Equations

Construction of asymmetric orthogonal arrays of strength three via a replacement method

An Application of Hardy-Littlewood Conjecture. JinHua Fei. ChangLing Company of Electronic Technology Baoji Shannxi P.R.China

Exponential Functions

CLONES IN 3-CONNECTED FRAME MATROIDS

Transcription:

Data-Flow Analyi or Hot-Spot Program Optimization Jn Knoop Tchnich Univrität Win 1 Motivation 2 A Poibly Hug Program Rgion x Hot Spot 1 Hot Spot 2 A Poibly Hug Program Rgion 3 4 A Poibly Hug Program Rgion x x A Poibly Hug Program Rgion 5 6 Availability at a Singl Program Point Why Standard Data-Flow Analyi Fail a) b) Availability o trm al i n = AVAIL(n) = [[ (m,n) ]](AVAIL(n)) othrwi m prd(n) a := b := a := b := whr [[ (m,n) ]](b) = (COMP (m,n) + b) TRANSP (m,n) b := a+b b := a+b 7 8

Outlin o th Talk Standard v. Rvr Data-Flow Analyi Background Ential Th Conncting Link Th Clou: Why do it work? Application Concluion 9 Background Dmand-Drivn Data-Flow Analyi Agrawal (2000) Horwitz, Rp, Sagiv (1994+) Dutrwald, Gupta, Soa (1995+) Knoop (Euro-Par 1999, KPS 2007) 10 Rvr Data-Flow Analyi: Th Baic (Standard) Data-Flow Analyi Data-Flow Lattic Ĉ =(C,,,,, ) Data-Flow Functional [[ ]] : E (C C) Rvr Data-Flow Analyi Rvr Data-Flow Functional (Hugh, Launchbury 1992+) [[ ]] R : E (C C) dind by E c C. [[ ]] R (c)= d {c [[ ]](c ) c } Availability o Trm Abtract mantic or availability o trm 1. Data-Flow Lattic: (C,,,,, )= d (B,,,,al,tru) 2. Data-Flow Functional: [[ ]] av : E ( B B ) dind by Ct tru i Comp Tranp E. [[ ]] av = d Id B i Comp Tranp othrwi Ct al 11 12 On th Rlationhip o [ ] and [ ] R Lmma 1. [[ ]] R i wll-dind and monotonic. 2. [[ ]] R i additiv, i [[ ]] i ditributiv. Monotonicity, Ditributivity, and Additivity o data-low unction. Dinition [Monotonicity, Ditributivity, Additivity] Lt Ĉ =(C,,,,, ) b a complt lattic and : C C a unction on C. Thn: i 1. monotonic i c,c C. c c (c) (c ) (Prrving th ordr o lmnt) 2. ditributiv i C C. ( C ) = {(c) c C } (Prrving gratt lowr bound) 3. additiv i C C. ( C ) = {(c) c C } (Prrving lat uppr bound) 13 14 Otn uul th ollowing quivalnt charactrization o monotonicity: Lmma On th Rlationhip o [ ] and [ ] R (Cont d) Lmma 1. [[ ]] R [[ ]] Id C, i [[ ]] i monotonic. Lt Ĉ =(C,,,,, ) b a complt lattic and : C C a unction on C. Thn: i monotonic C C. ( C ) {(c) c C } ( C C. ( C ) {(c) c C } ) 2. [[ ]] [[ ]] R Id C, i [[ ]] i ditributiv. In trm o th thory o abtract intrprtation : [[ ]] and [[ ]] R orm a Galoi-connction. 15 16

Rvr : Th R-MinFP -Approach Th R-MinFP -Equation Sytm: c q i n=q rqin (n)= {[[ (n,m) ]] R (rqin (m)) m ucc(n) } othrwi Th R-MinFP -Solution: c q C n N. R-MinFP cq (n)= d rqin c q (n) whr rqin c q dnot th lat olution o th R-MinFP -quation ytm wrt c q C. 17 Standard : Th MaxFP -Approach Th MaxFP -Equation Sytm: c i n= in (n) = {[[ (m,n) ]](in (m)) m prd(n) } othrwi Th MaxFP -Solution: c C n N. MaxFP ([[ ]],c)(n)= d in c (n) whr in c dnot th gratt olution o th MaxFP -quation ytm wrt c C. 18 Th Conncting Link Link Thorm For ditributiv data-low unctional [[ ]], q N, and c,c q C, w hav: R-MinFP cq () c MaxFP c (q) c q Continuing th Analogy o Standard and Rvr Data-Flow Analyi rgarding Soundn & Compltn (in trm o program vriication) / Saty & Coincidnc (Prciion) (in trm o data-low analyi) 19 20 Ential th xtnibility o data-low unctional to path Id C i q <1 [[ p ]]= d [[ 2,, q ]] [[ 1 ]] othrwi Th MOP -Approach c C n N. MOP c (n)= {[[ p ]](c ) p P[,n] } 21 22 Standard : Main Rult Thorm [Soundn / Saty] c C n N. MaxFP c (n) MOP c (n) i th data-low unctional [[ ]] i monotonic. Standard : Th Tool Kit Viw at a glanc: Intraprocdural C Spciication c 0 Thorm [Compltn / Coincidnc (Prciion)] Intraprocdural Framwork Thory Practic Tool Kit Gnric Fixd Point Alg. A.1 c C n N. MaxFP c (n)=mop c (n) i th data-low unctional [[ ]] i ditributiv. Program Proprty φ Equivalnc Intraprocdural Trmination Lmma Intraprocdural Intraprocdural Coincidnc Thorm Corrctn Lmma MOP-Solution MFP-Solution Computd Solution 1 2 3a) 3b) 23 24

O cour Rvr data-low unctional can b xtndd to path, too: Id C i q <1 [[ p ]] R = d [[ 1,, q 1 ]] R [[ q ]] R othrwi 25 Th R-JOP -Solution: Th R-JOP -Approach c q C n N. R-JOP cq (n)= d {[[ p ]] R (c q ) p P[n,q]} 26 Rvr : Main Rult Putting it togthr Thorm [Soundn / Rvr Saty] c q C n N. R-MinFP cq (n) R-JOP cq (n) Data-low Analyi PV {p}π {q} Program Vriication Thorm [Compltn / Rvr Coincidnc (Prciion)] MaxFP Coincidnc Thorm MOP (q) c c q C ditributiv induc C Strongt Potcondition Viw {p} π {?} c q C n N. R-MinFP cq (n)=r-jop cq (n) Link Thorm i [[ ]] i ditributiv. Rvr Coincidnc Thorm R-JOP R-MinFP c ( q ) c R (c) = d {c (c ) c} {?} π {q} Wakt Prcondition Viw 27 28 Ar W Don? Rcall th motivating xampl A Poibly Hug Program Rgion Matring th Road to Succ rquir mor. It rquir u to conclud rom wakt pr-condition on trongt pot-condition. x ntially, thi man to rplac th analyi problm by a vriication problm. A Poibly Hug Program Rgion 29 30 Changing th Prpctiv Implmntation Problm Spciication Problm Vriication Problm Changing th Prpctiv: Th Standard Taxonomy!cti?wci!cti Convntional Claiication o Tchniqu? ci! cpi! cpi! Givn: Contxt Inormation cti! Givn: Componnt Inormation cpi! Givn: Contxt Inormation cti Componnt Inormation cpi Exhautiv Dmand-Drivn? Sought: Strongt Componnt Inormation ci? Sought: Wakt Contxt Inormation wci? Sought: Validity o cpi with rpct o cti 31 32

Changing th Prpctiv: Concluion Drivd Th pciication problm: {?} π {q} Th vriication problm: {p} π {q}? th domain o dmand-drivn Th implmntation problm: {p} π {?} th domain o xhautiv 33 (R)-Framwork / (R)-Tool Kit Th Standard Viw Strongt Pot-condition Problm Partial (By-nd + Early Trmination) BN-MaxFP Exhautiv Program Analyi Formally anwr Formally anwr ( ) ( ) MaxFP MOP R-JOP R-MinFP 34 Wakt Pr-condition Problm Exhautiv Th Dual Viw Partial (Dmand-drivn + Early Trmination) DD-R-MinFP Gn/Kill-Problm allow u to matr th road to ucc: Th SPC-analyi problm boil down to a WPC-vriication problm. Thi i important bcau Rdundant Exprion/Aignmnt Elimination Dad-Cod Elimination Strngth Rduction Concluding th Exampl: Availability Abtract mantic or availability 1. Data-low lattic: (C,,,,, )= d (B X,,,,al,ailur) with =al tru ailur = 2. Data-low unctional: [[ ]] av : E ( B X B X ) dind by Ct X tru i Comp Tranp E. [[ ]] av = d Id BX i Comp Tranp othrwi Ct X al ar bad on Gn-Kill-problm. 35 36 Rvr Availability Rvr abtract mantic or availability 1. Data-low lattic: (C,,,,, )= d (B X,,,,al,ailur) 2. Rvr data-low unctional: [[ ]] avr : E ( B X B X ) dind by R-Ct X tru E. [[ ]] avr = d R-Id BX R-Ct X al i [[ ]] av =Ct X tru i [[ ]] av =Id BX i [[ ]] av =Ct X al Supporting Function al b B X. R-Ct X tru(b) = d ailur b B X. R-Ct X al al(b) = d ailur R-Id BX = d Id BX i b B othrwi (i.., i b=ailur) i b=al othrwi 37 38 Summing Up / Extnion (R)-Framwork / (R)-Tool Kit (Cont d) In thi talk th gnral pattrn: Th intraprocdural baic tting o (R) (Knoop, KPS 2007) Spciication Extnion ar poibl Framwork Thory Practic Intrac Tool Kit Intrprocdural tting (Knoop, CC 1992, LNCS 1428 (1998)) Gnric Fixd Point Alg. Paralll tting (Knoop, Euro-Par 1999) Program Proprty φ Equivalnc MOP-Solution Coincidnc Thorm MFP-Solution Corrctn Lmma Trmination Computd Solution 1 2 3a) 3b) Lmma 39 40

(R)-Framwork / (R)-Tool Kit th gnral pattrn mor abtract: Program Proprty φ Proo Obligation: Intraprocdural Intrprocdural Conditional Spciication Ectivity Coincidnc Thorm Thorm 3a) 3b) 1 2 3a) 3b) Equivalnc Paralll Coincidnc Framwork 41 Corrctn Trmination Ectivity From Application toward Concluion a) c := a+b rad(a,b) x a := "Hot Spot" Optimizr Program point atii availability, whil do not! Application b := writ(c) b) 42 c := a+b rad(a,b) a := Dbuggr b := writ(c) Variabl c i not initializd along om path raching program point g Rvr Data-Flow Analyi pcially wll-uitd or Hot-Spot Optimization Dbugging Jut-in-tim Compilation Concluion (Cont d) bad on anwring data-low quri. Hnc A an appaling add-on R i tailord or paralllization! Data-Flow Analyi or Dbugging Data-Flow Analyi or Jut-in-tim Compilation wr titl conidrd optionally. 43 44 Rcall again A Poibly Hug Program Rgion Concluion and Prpctiv x Data-Flow Analyi or Multi-Cor Architctur A Poibly Hug Program Rgion 45 46