




















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
Material Type: Notes; Professor: Mahlke; Class: Advanced Compilers; Subject: Electrical Engineering And Computer Science; University: University of Michigan - Ann Arbor; Term: Winter 2006;
Typology: Study notes
1 / 28
This page cannot be seen from the preview
Don't miss anything!





















Reading Material
Two Types of Analysis Y
Properties about the values thatpredicates can take on »^
Disjoint
= 2 predicates never
true at the same time »^
Superset
= 1 predicate true
more often »^
Subset
= 1 predicate true less
often »^
Predicate query system
Y
Calculate dataflow informationon predicated code »^
GEN/KILL now occur on acertain predicate (not always)
t = pclearx =p,q = cmpp.uc.un (a<b)t = cmpp.oc(a<b)x =
if p
x =
if q
r,s = cmpp.un.uc(c!=d)
if q
t = cmpp.on(c!=d)
if q
x =
if s
= y
if r
= x
if t
= x
Predicate Relation Analysis Y
1 = all execution traces
Y
Denoted as P »^
P is a subset of 1
Y
Execution traces^ y
trace
p^
q^
r^
s^
t
y^
e
1
0
0
0
1
y^
e
0
1
1
0
1
y^
e
0
1
0
1
0
Execution sets^ y
P = {e1}, Q = {e2,e3}, R = {e2}, S= {e3}, T = {e1,e2}, 1 ={e1,e2,e3}
t = pclear x = p,q = cmpp.uc.un (a<b) t = cmpp.oc(a<b) x =
if p
x =
if q
r,s = cmpp.un.uc(c!=d)
if q
t = cmpp.on(c!=d)
if q
x =
if s
= y
if r
= x
if t
= x
p^
q r^
s
t
Class Problem – Create the Execution Sets^ r = pclear^ x =^ p,q = cmpp.un.uc (a == b)^ x =
Partitioning by a CMPP
u m
n
Partition Graph Y
Edge from U to M »^
Edge from U to N »^
M and U
N denoted to
come from same partition
Y
p = (a<b) * true q = !(a<b) * true r = (c>d) * p s = !(c>d) * p u = (e!=5) * true v = !(e!=5) * true
p^
q^
u^
v
r^
s
Partition Graph Properties Y
Y
Y
Y
Y
Level(root) = 0
Y
p = (a<b) * true q = !(a<b) * true r = (c>d) * p s = !(c>d) * p u = (e!=5) * true v = !(e!=5) * true
p^
q^
u^
v
r^
s
Synthesizing New Partitions
1 p^
q r^
s
p^
q r^
s
t^
t^ lca(p,r) = 1^ 1 – t = 1 – (p + r) = 1 – p – r = s
Identify partition, U = M|N where U is not reachable from 1 If M,N are reachable from 1, then there exists a partition
lca(M,N) = U|V, where V is the relative complement
of U with respect to lca(M,N)
Class Problem – Create the Partition Graph^ r = pclear^ x =^ p,q = cmpp.un.uc (a == b)^ x =
if p
x =
if q
r,s = cmpp.on.uc(c < d)
if p
r,t = cmpp.on.uc(e > f)
if s
u,v = cmpp.un.uc
if r
x =
if s
x =
if v
= x
if r
x =
if t
= x
Implementing PQS Functions in 1-dnf
1 p^
q r^
s
is_disjoint(p,q) = if there is a partition with p on 1 side, q on the other, then disjoint is_subset(p,q) = if q is an ancestor, then p is a subset lub_sum(p, E) = return p + qi for all qi in E. (Remove redundant/subsumed terms)
t
Examples:
Are p and s disjoint? Are t and p disjoint? Is r a subset of p? Is s a subset of q? s + {q} =? r + {s} =? p + {r,s} =?
Implementing PQS Functions in 1-dnf (2) lub_diff(E, p) = return Sum(qi-p) for all qi in E. 4 subcases
qi removed, E += NULL
E += rel_cmpl(p,qi)
E += qi
E += approx_diff(p,q)
/* q – p */ approx_diff(p,q)
relative_complement(p, lca(p,q)) relative_complement(p,q)
find a path from q to p E = false for each edge r
s on path do
let R = S|Ti be the partition
containing r
s
add Ti to E return E
1 p^
q r^
s
t
Examples: {q} – r =? {q} – p =? {t} – r =? {t} – s =?
Predicate-Sensitive Liveness
Destination operands
GEN’(x) = GEN(x) – Q KILL’(x) = KILL(x) + Q
Source (data) operands GEN’(y) = GEN(y) + Q KILL’(y) = KILL(y) - Q
Source (predicate) operands
backward analysis
GEN’(q) = GEN(q) + true = true KILL’(q) = KILL(q) – true = false
What About UN/UC CMPP’s?
Destination operands
GEN’(p) = GEN(p) – true = false KILL’(p) = KILL(p) + true = true
Source (data) operands GEN’(a) = GEN(a) + true = true KILL’(a) = KILL(a) – true = false
Source (predicate) operands
backward analysis
GEN’(q) = GEN(q) + true = true KILL’(q) = KILL(q) – true = false