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

A homework assignment focused on dataflow analysis. The assignment includes building a control-flow graph, computing live-variables at entry and exit of each basic block, and converting the cfg into static single assignment (ssa) form. The code snippet given is in pascal language and includes variables a, b, i, and g, with assignments, conditional statements, and loops.

Typology: Assignments

Pre 2010

Uploaded on 08/18/2009

koofers-user-68k
koofers-user-68k 🇺🇸

10 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

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.