II Mid CD Important Qns
II Mid CD Important Qns
II Mid CD Important Qns
IMPORTANT QUESTIONS
7. a)Generate the code f. the following expression: x = (a + b) – ((c + d) – e). Also Compute its
cost. (CO2)
b)Write a procedure to identify basic blocks. (CO3)
8. a) What are the object code f.ms? Explain the issues in code generation. (CO2)
b) Illustrate loop optimization with suitable example. (CO3)
.
9. Explain in detail the procedure that eliminates global common sub expression. (CO1)
10. Explain various method to handle peephole optimization. (CO2)
.
11. Define Flow Graph? Explain how a given program can be converted in to flow graph. (CO1)
7. Explain the following with an example: a) Redundant sub expression elimination b) Frequency
reduction c) Copy propagation. (CO2)
8. Optimize the following code using various optimization techniques: i=1; s=0;
f. (i=1; i<=3; i++)
f. (j=1;j<=3;j++)
c[i][j]=c[i][j] + a[i][j] + b[i][j] (CO3)
.
9.a) Discuss and analyze all the allocation strategies in a run-time st.age environment. (CO1)
b) Write the alg.ithm f. a simple code generat.. And explain various issues that
affect the efficiency of generated code. (CO2)
10. a)Explain in brief about function preserving transf.mations on basic blocks. (CO1)
b) Explain in brief about Induction variable elimination. (CO2)
.
11. Describe the application of peephole? What kinds of peephole techniques can be
used to perf.m machine-dependent optimizations? (CO3)