[30 points] Consider the following program segment. The set annotations
show the set of variables that are live before the statement.
int
b = 1,
e = 2,
d = 3,
a = 4;
// { a, b, d, e} live here
print a, d;
int
f = 3,
c = 4;
// { b, c, e, f} live here
print b, c, e, f;
- [15 points]
Using the graph below (or a transcription of that graph into your
exam paper), draw the interference graph based on the program segment
and its live variables information.
- [15 points]Apply the Chaitin/Chandra heuristic to color your graph using k=4
colors. Show your work, especially the stack ov erticies when the graph
has been fully reduced. Be sure to indicate which register {1..4} is
assigned to each variable.