[Instructions] [Search] [Current] [Syllabus] [Handouts] [Outlines] [Assignments]
Held Wednesday, December 2, 1998
Handouts
Notes
in
: the variables needed/live just before the statement;
out
: the variables needed/live after the statement;
use
: the variables used within the statement;
def
: the variables defined by the statement;
succ
: the successors of a statement; and
pred
: the predecessors of a statement.
use(x)
is a subset of in(x)
out(x)
is a superset of in(y)
for each
y
that can follow x
.
in(x)
is a superset of out(x)-def(x)
.
in(x) = use(x) union (out(x)-def(x)) out(x) = { v in in(y) | y in succ(x) }
s0: a := 0 s1: a := b + c s2: b := a s3: end
use(s0) = { } use(s1) = { b, c } use(s2) = { a } use(s3) = { } def(s0) = { a } def(s1) = { a } def(s2) = { b } def(s3) = { } succ(s0) = { s1 } succ(s1) = { s2 } succ(s2) = { s3 } succ(s3) = { }
in
and out
satisfy
the equations given earlier?
in(s0) = { q,b,c } out(s0) = { q,b,c } in(s1) = { q,b,c } out(s1) = { q,a,b,c } in(s2) = { q,a,c } out(s2) = { q,a,b,c } in(s3) = { q,a,b,c }
in(s0) = { b,c } out(s0) = { b,c } in(s1) = { b,c } out(s1) = { a } in(s2) = { a } out(s2) = { } in(s3) = { }
in
and out
?
computed used and def for each statement // the prior step is typically done during translation foreach statement, s in(s) = used(s) repeat foreach statement s in(s) = in(s) + (out(s)-def(s)) foreach predecessor, p, of s out(s) = out(s) + in(p) until no changes are made
History
Back to Generating assembly code. On to Register Allocation.
[Instructions] [Search] [Current] [Syllabus] [Handouts] [Outlines] [Assignments]
Disclaimer Often, these pages were created "on the fly" with little, if any, proofreading. Any or all of the information on the pages may be incorrect. Please contact me if you notice errors.
Source text last modified Thu Dec 3 09:11:46 1998.
This page generated on Thu Dec 3 09:27:52 1998 by SiteWeaver.
Contact our webmaster at rebelsky@math.grin.edu