II Mid CD Important Qns

You might also like

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 2

CMR ENGINEERING COLLEGE

III.B.TECH- II-SEM-II MID EXAMINATIONS,


Subject:CS601PC-COMPILER DESIGN

IMPORTANT QUESTIONS

1. Define Type Equivalence? (CO1)


2. Which graph is used f. identifying the common sub expression in an expression? (CO3)
3. Define Basic Block. (CO1)
4. How can you identify the leader in a Basic block? (CO2)
5. What is meant by Reaching Definitions. (CO1)

6.Translate the following expression:


(a+b)*(c+d)+(a+b+c) into quadruples and triples and indirect triples. (CO3)

7.a) What is liveness?Explain liveness with suitable example. (CO1)

b) Write a procedure to identify basic blocks. (CO2)

8. Write the code generation f. the d:=(a-b)+(a-c)+(a-c). (CO2)


9. Discuss about the following: (CO3)
a) Copy Propagation b) Dead code Elimination and c) Code motion

10. Explain about data flow analysis. (CO2)


.
11. Explain in detail about machine dependent code optimization techniques. (CO1)

1. What is activation rec.d? (CO1)


2. What is dead code elimination and reduction in strength? (CO1)
3. Define loop unrolling. Give an example. (CO2)
4. What is meant by register descript. and address descript.? (CO1)
5. How to allocate registers to instruction? (CO3)

6. a)What is DAG? Construct DAG f. the following Basic block. (CO1)


D: = B*C; E:= A+B; B:=B+C; A:=E-D;
b) Explain how copy propagation can be done using data flow equation. (CO3)

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)

1.What are the benefits of intermediate code generation? (CO2)


2. What is a basic block? (CO2)
3. Discuss about common sub expression elimination. (CO2)
4. How do you calculate the cost of an instruction? (CO3)
5. List out the common issues in the design of code generat.. (CO1)

6. a)Give an example to show how DAG is used f. register allocation. (CO3)


b)Generate intermediate code f. the following code segment along with the required
syntax directed translation scheme:
if(a>b)
x=a+b
else
x=a-b
Where a and x are of real and b of int type data. (CO3)
.

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)

You might also like