04 - More Data Flow Analysis Work List Iterative Algorithm...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
More Data Flow Analysis Last Time Data Flow Analysis Data Flow Frameworks Constant Propagation Framework Reaching Defnitions Today Iterative Worklist Algorithm via Reaching Defnitions Why it works What it computes CS 380C Lecture 4 1 Data Flow Analysis Work List Iterative Algorithm for v V IN( v )= /0 OUT( v )=GEN( v ) endfor worklist v V while ( worklist ± = ) pick and remove a node v ±rom worklist oldout( v )=OUT( v ) IN( v S (OUT( p )), p PRED( v ) OUT( v v ) S (IN( v ) - KILL( v )) if oldout( v ) ± = OUT( v )then worklist worklist SUCC( v ) endwhile CS 380C Lecture 4 2 Data Flow Analysis
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Work List Iterative Algorithm Questions Does this always terminate? How fast (or slow) is it? What answer does it compute? How fast can we make it? CS 380C Lecture 4 3 Data Flow Analysis Termination Why does the iterative data fow algorithm terminate? Sketch oF prooF For reaching de±nitions 1. each node is initialized to /0 2. a de±nition has only one statement that generates it 3. F is associative F is monotone each x Reaching de±nitions can be added once 4. N * ( E + 1 ) trips to take a de±nition to every node Consequence oF ±nite descending chain property Question: How do we generalize this proof? CS 380C Lecture 4 4 Data Flow Analysis
Background image of page 2
Correctness and Quality of Solution Does it compute the answer we want? DeFnition: For each basic block b MOP( b )= ± f p ( ² ) ,fo ra l lpaths p “reaching” b Paths that reach a block are reachable in the control ±ow graph, which may be conservative. Perfect Solution = meet over real paths taken during program execution MOP Perfect Solution In some sense, MOP is best feasible solution Not guaranteed to achieve MOP solution MOP is undecidable, even for monotonic framework Reduction to Modi²ed Post’s Correspondence Problem Reference:
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/09/2012 for the course CS 380 taught by Professor Shmat during the Fall '08 term at University of Texas at Austin.

Page1 / 9

04 - More Data Flow Analysis Work List Iterative Algorithm...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online