Consider the following sequence of IR code:    1. a1 = a2;…

Consider the following sequence of IR code:    1. a1 = a2; 2. b1  = b2; label_0:  3. t1 = i * 4;  4. if (a1 < b1) goto label_1; 5. t2 = a1 * t1;  6. i = i + 1;  7. b2 = b1;  8. goto label_2; label_1:  9. t2 = b1 * t1;  10. i = i - 1;  11. a2 = a1;  12. if (a2 < 10) goto label_3; label_2:  13. a1 = a1 + a2;  14. b1 = b1 + b2;  15. i = i * 2;  16. goto label_0; label_3:  17. t1 = t2;  18. t2 = t2 + 2;  19. a1  = a2; 20. b1 = b2; 21. return;  Detect basic blocks and generate the control flow graph.  Write each basic block as e.g. B0 = {1, 2, 3} to show that basic block B0 contains the statements numbered 1, 2, and 3 above. Show the structure of the control flow graph as e.g. B1 = {B2, B3, B0} to show edges from B1 to B2, B1 to B3, and B1 to B0.  Perform liveness analysis on the control flow graph and show the LiveIn and LiveOut sets for each basic block.  Write the sets in the format of e.g. In[B1] = {a, b, c, ...}

Many compilers utilize separate compilation; a scheme in whi…

Many compilers utilize separate compilation; a scheme in which the compiler or assembler emits object files where memory addresses are specified as offsets relative to a section whose location is not fixed, and such object files may be linked with other objects to produce the final executable. State an optimization that would be illegal for a compiler using separate compilation to perform, but would be permissible for a link-time optimizer to perform when producing the final executable.  Describe why this optimization cannot be performed during compilation but can be performed at link time.