DAG Representation of Basic blocks
A DAG for a basic block is a directed cyclic graph
with the following labels on nodes:
[Link] are labeled by unique identifiers, either
variable names or constants. From the operator
applied to a name we determine whether the lvalue or r-value of a name is needed; most leaves
represent r-values. The leaves represent initial
values of names, and we subscript them with 0 to
avoid confusion with labels denoting current
values of names as in (3) below.
[Link] nodes are labeled by an operator symbol.
[Link] are also optionally given a sequence of
identifiers for labels. The intention is that interior
nodes represent computed values, and the
DAG Representation of Basic blocks
1. t1 := 4 * i
2. t2 := a[t1]
3. t3 := 4 * i
4. t4 := b[t3]
5. t5 := t2 * t4
6. t6 := prod + t5
7. prod := t6
8. t7 := i + 1
9. i := t7
[Link] i <= 20 goto
(1)
DAG Representation of Basic blocks
t6 prod
+
prod0
* t5
t2[ ]
a
(1)
<=
t4
[]
b
*
4
t1 t3
i0
+t7 i 20
1