






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A series of lecture notes on reaching definition in dataflow analysis. It covers topics such as taxonomy of dataflow problems, techniques for forward and backward analysis, and specific dataflow problems like if-then constructs, if-then-else constructs, while loops, and improper regions. The notes also include examples and explanations of flow functions and lattice concepts.
Typology: Slides
1 / 11
This page cannot be seen from the preview
Don't miss anything!







Definition: Assignment of a value to a variable A definition d of a variable reaches a point p if there is a path from d to p and value of a variable is same as assigned at d Use iterative forward bit vector problem A bit vector of a 8 bit can be used to represent all the definition Initial condition in(entry) = = 00000000 in(i) = = 00000000 for all nodes i If an instruction re-defines a variable then it is killed
Gen: Definitions generated in a basic block and not subsequently killed in it gen(B1) = 1, 2, 3 = 11100000 gen(B3) = 4 = 00010000 gen(B6) = 5, 6, 7, 8 = 00001111 gen(i) = = 00000000 for i 6= B1, B3, B
Out: Definitions which reach at the end of a basic block out(i) = = 00000000 for all i A definition reaches end of a basic block iff either
It is generated in the basic block OR It reaches in and is preserved
A set of values ’Meet’ operator ’Join’ operator
such that (closure)
(Commutative)
and (associate)
and (distributive)
It has two unique element top and bottom Such that
Elements are bit vectors Meet is bitwise and Join is bitwise or Bottom is 0 n^ and top is 1 n BV n^ denotes lattice of n bits for example BV 3 is
A function f mapping a lattice to itself f:L → L is monotonic if for all x, y
for example f : BV 3 → BV 3 defined as f : (x 1 , x 2 , x 3 ) → (x 1 , 1, x 3 ) is monotonic Height: it is the length of the longest ascending chain such that there exists x 1 , x 2 ,... , x (^) n such that
Monotonicity and finite height ensure that the data-flow algorithms implementing function f terminate flow function maps lattice to lattice. Flow function for B 1 is given as
Let F (^) B () be the flow function representing flow through block B and F (^) p represent the composition of the flow functions encountered in following path p then
If we do not distinguish between and then
in(if) = in(if-then) in(then) = (in(if))
If we do not distinguish between the true and the false parts
in(if) = in(if-then) in(then) = (in(if))
-then –else = (F then ) (F else o )
in(if) = in(if-then-else) in(then) = (in(if)) in(else) = (in(if))
in(while) = (in(while-loop)) in(body) = (in(while))
If we do not distinguish between and^ then
In(while) = (in while- loop)) In(body) = (in (while))
file:///D|/...ry,%20Dr.%20Sanjeev%20K%20Aggrwal%20&%20Dr.%20Rajat%20Moona/Multi-core_Architecture/lecture%2029/29_10.htm[6/14/2012 12:09:58 PM]
Consider the flow graph in an earlier slide and its structural flow analysis
For entrya block
file:///D|/...ry,%20Dr.%20Sanjeev%20K%20Aggrwal%20&%20Dr.%20Rajat%20Moona/Multi-core_Architecture/lecture%2029/29_10.htm[6/14/2012 12:09:58 PM]
For if-then else block