# In-Class Exercise 8: SSA Destruction Consider the following pseudo-SSA. fn(%0, %1) { b1: %2 = add %0, %1 br %b2 b2: %3 = phi [%b1: %1], [%b3: %4] %4 = phi [%b1: %0], [%b3: %3] %5 = phi [%b1: %2], [%b3: %3] %6 = phi [%b1: 0], [%b3: %8] %7 = icmp lt %3, %6 br %7, %b3, %b4 b3: %8 = add %6, 1 %9 = icmp gt %8, %1 br %9, %b4, %b2 b4: %10 = phi [%b2: %4], [%b3, %3] %11 = phi [%b2: %5], [%b3, %8] %12 = add %10, %11 ret %12 } 1. Are there dependencies between phi nodes? If so, which? 2. Does the CFG contain critical edges? 3. Destruct SSA and transform the code into a form where you have unlimited registers. This means that you can assign values multiple times. 3.1. Do by breaking critical edges. 3.2. Do by copying used values. ## Solution ``` base64 -d <