



















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
An overview of data flow analysis, a technique used in compiler optimization. The structure of a compiler, the concept of control flow graph (cfg), and the use of cfgs in data flow analysis. It also discusses variations on cfgs, available expressions, and liveness analysis. From the fall 2007 edition of cmsc 631.
Typology: Study notes
1 / 27
This page cannot be seen from the preview
Don't miss anything!




















CMSC 631 2
Source Code
Abstract Syntax Tree
Control Flow Graph
Object Code
CMSC 631 3
CMSC 631 4
x := a + b
y := a * b
y > a
a := a + 1
x := a + b
CMSC 631 7
x := a + b
y := a * b
y > a
a := a + 1
x := a + b
exit
entry
CMSC 631 8
CMSC 631 9
CMSC 631 10
CMSC 631 13
{a + b}
{a + b, a * b}
{a + b, a * b}
{a + b}
{a + b}
{a + b}
{a + b}
x := a + b
y := a * b
y > a
a := a + 1
x := a + b
entry
exit
CMSC 631 14
CMSC 631 15
CMSC 631 16
CMSC 631 19
{x}
{x, y, a}
{x, y, a}
{y, a, b}
{y, a, b}
{x, a, b}
{a, b} x := a + b
y := a * b
y > a
a := a + 1
x := a + b
{x, y, a, b}
{x, y, a, b}
CMSC 631 20
CMSC 631 21
CMSC 631 22
May Must
Forward
Reaching definitions
Available expressions
Backward Live variables
Very busy expressions
CMSC 631 25
CMSC 631 26
ā
ā
CMSC 631 27
S
CMSC 631 28
ā // Slight acceleration: Could set Out(s) = Gen(s) (Top - Kill(s))
CMSC 631 31
repeat
Take s from W
temp := f s
sā² pred(s)
Out(sā²)) (f s
monotonic transfer fn )
if (temp != Out(s)) {
Out(s) := temp
W := W U succ(s)
}
until W =
CMSC 631 32
CMSC 631 33
CMSC 631 34
CMSC 631 37
CMSC 631 38
CMSC 631 39
CMSC 631 40