Unit 5 Part 3
Unit 5 Part 3
● set of techniques that derive information about the flow of data along program
execution paths.
● one way to implement global common subexpression elimination requires us
to determine whether two textually identical expressions evaluate to the same
value along any possible execution path of the program.
● If the result of an assignment is not used along any subsequent execution
path, then we can eliminate the assignment as dead code
Data Flow Abstraction
● the execution of a program can be viewed as a series of transformations of
the program state, which consists of the values of all the variables in the
program, including those associated with stack frames below the top of the
run-time stack. Each execution of an intermediate-code statement transforms
an input state to a new output state.
a= 5
I/P State
a=a*5
O/P State
● The input state is associated with the program point before the statement and
the output state is associated with the program point after the statement.
Find Path From Flow Graphs
Path Example
a=5 a = a*5
b=a
Data Flow Analysis Schema
Constraint - Transfer Function , Control Function
a=5 a=5
b = a+10 b = a+10
c = c*a a=a+1
c = c*a
Live Variable Analysis