Docsity

Dataflow Analysis Homework: Control-Flow Graph, Live-Variables, and SSA Form, Assignments of Computer Science

Toggle sidebar
bg1
Homework 5: Dataflow Analysis(30pts)
Due Nov 24, 2008
Suppose we have the following code.
a := 200
b:=a-2;
i := 0;
L: if (a > i) goto E
b := b- 2;
i:=i+3;
c:=a+b;
goto L
E:g:=2*b
1. (10pts) Build control-flow graph for the above code.
2. (10pts) Compute the set of live-variables at the entry and exit of each basic block
through each iteration of the live-variable analysis algorithm.
3. (10pts) convert the CFG into SSA form.
1

Partial preview of the text

Download Dataflow Analysis Homework: Control-Flow Graph, Live-Variables, and SSA Form and more Assignments Computer Science in PDF only on Docsity!

Homework 5: Dataflow Analysis(30pts)

Due Nov 24, 2008

Suppose we have the following code.

a := 200 b := a - 2; i := 0; L: if (a > i) goto E b := b- 2; i := i + 3; c := a + b; goto L E: g := 2 * b

  1. (10pts) Build control-flow graph for the above code.
  2. (10pts) Compute the set of live-variables at the entry and exit of each basic block through each iteration of the live-variable analysis algorithm.
  3. (10pts) convert the CFG into SSA form.