Question: 6 Dataflow and Register Allocation ( 3 2 Points ) 1 . You are given the control - flow graph for a function that uses

6 Dataflow and Register Allocation (32 Points)
1. You are given the control-flow graph for a function that uses variables \( a \) to \( g \), with \( a \) and \( b \) being the arguments and \( g \) and \( f \) the return values. Part of the program statements and part of the set of variables that are live right after/before the corresponding statement have been removed from this graph, and replaced by empty boxes / brackets. Fill in the missing program statements in the boxes and the missing set of variables that are live right after/before the corresponding statements so that the live sets are consistent with the code.
Program statements can take one of the following forms: \( x=1, x=y \) or \( x=y+z \)(where \( x, y \) and \( z \) can be any one of the variables used by the function). If more than one statement would work in some position, pick the simplest one (prefer \( x=1\) over \( x=y \), and \( x=y \) over \( x=y+z \)).
2. Give the register interference graph for the above code. [8 Points]
6 Dataflow and Register Allocation ( 3 2 Points )

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!