Data Flow
Data Flow
data items
1. Available expressions,
2. Reaching definitions,
3. Live variables,
4. Busy expressions.
The data flow analysis is a process of computing values of data flow properties.
In this section we will discuss some of the data flow properties in detail.
point.
A program point at which some evaluating expression is given is called
evaluation point.
For examnple:
Definition W:X3
point
Reference W: y X
point
1.A v a l l a
Avaa .V+Vx+y available
is availabl at a
program point w if and
A n
ssion
e x p r e s s i
Forexample:
4 B1
e ctdLI B2
4iB3
fea B4
Fig. 10.4.1 (b)
The expression 4* i is the available expression for
B2, Ba and B4 because this
expression is not been changed by any of the block before
appearing in B.
Advantage of available expression
The use of available expression is to eliminate common sub expressions.
2. Reaching definitions
d1:y2 B1
d2: XHy2 82
d2: yi y+2 B2
d3: Xy+283
Fig. 10.4.2 (b)
The definition dl is said to a reaching definition for block B2. But the definition d
is not a reaching definition in block B3, because it is killed by definition d2 in block RD
For example:
x 5 B1
B27
x is live
84 t x at block
B5 B1, B3, B4
but killed
at B6
x:=t+wB6
D 10 B7
Fig. 10.4.3 Live variables
Advantages of live variables
.
Live variables are useful in
register allocation.
.Live variables are
useful for dead code elimination.
4 B u s y e x p r e s s i o n
e an expression
Pi
gets evaluated
e Busy expression
Fig. 10.4.4