Question 1
6.2. Given the following 3AC, identify the basic blocks and draw the flow
diagram:
(1) B: C
(2) I:= 0
(3) T: 4 * I
(4) U: A [T]
(5) V: U * U
(6) W: 4 * I
(7)
A [W]:= V
(8)
if V > D goto 13
(9)
I:= I + 1
(10)
if I < B goto 3
(11) X := C + D
(12) E: X
(13) Y: C+ B
(14) F: Y
Question 2
6.3. Construct the DAG for the following basic block:
T1: c * d
T2: b + T1
T3: c * d
T4: b + T3
T5: c * d
T6: b - T5
T7: T4 / T6
T8: T2 + T7
a := T8