BuildSSAExam

advertisement
CSCE 5655 Final Exam --- Part 1
Due 12/12/13 at 5:30pm CST
To complete this portion of the final exam, you are free to use written or online material
other than something specifically requested for this exam. You are NOT to discuss this
exam with any human other than myself --- and I won’t be much help.
Consider the following control flow graph:
i=0
a=0
B1
b=3
B2
X=a+1
B3
B4
c=a+2
c=b+5
b=a+2
B5 d = a + b
B7
B6
B8
c=c+1
d=a+c
B9
c=a -c
a=a+1
i=i+1
B10
X=a+b+c+d
return
i=i+1
In the above control-flow graph, X is a global variable. All other variables listed should be
considered local variables. (In this context, local means within the function represented by
the control flow graph. Global means the variable has program scope.)
Complete the following:
1. Show the Dominator Tree.
2. Show the Post-Dominator Tree.
3. List the dominator frontier for each basic block of the CFG.
4. Insert the (non-minimal) phi-nodes inserted by the simple algorithm of Morgan.
Download