Chapter 9: Code generation

Rearranging order of the code

. Consider following basic block
 
t 1 = a + b
t 2 = c + d
t 3 = e -t 2
X = t 1 -t 3
 
and its DAG

Here, we briefly consider how the order in which computations are done can affect the cost of resulting object code. Consider the basic block and its corresponding DAG representation as shown in the slide.