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

COMPILER DESIGN MID-II IMPORTANT QUESTIONS

1. Define Type Equivalence?


2. Which graph is used for identifying the common sub expression in an expression?
3. Define Basic Block.
4. How can you identify the leader in a Basic block?
5. What is meant by Reaching Definitions.
6. Translate the following expression:
(a+b)*(c+d)+(a+b+c) into quadruples and triples and indirect triples.
7. What is liveness?Explain liveness with suitable example.
8. Write a procedure to identify basic blocks.
9. Write the code generation for the d:=(a-b)+(a-c)+(a-c).
10. Discuss about the following:
a) Copy Propagation b) Dead code Elimination and c) Code motion
11. Explain about data flow analysis.
12. Explain in detail about machine dependent code optimization techniques.
13. What is activation record?
14. What is dead code elimination and reduction in strength?
15. Define loop unrolling. Give an example.
16. What is meant by register descriptor and address descriptor?
17. How to allocate registers to instruction?
18. What is DAG? Construct DAG for the following Basic block.
D: = B*C; E:= A+B; B:=B+C; A:=E-D;
19. Explain how copy propagation can be done using data flow equation.
20. Generate the code for the following expression: x = (a + b) – ((c + d) – e). Also Compute its cost.
21. Write a procedure to identify basic blocks.
22. What are the object code forms? Explain the issues in code generation.
23. Illustrate loop optimization with suitable example.
24. Explain in detail the procedure that eliminates global common sub expression.
25. Explain various method to handle peephole optimization.
26. Define Flow Graph? Explain how a given program can be converted in to flow graph.

1
27. What are the benefits of intermediate code generation?
28. What is a basic block?
29. Discuss about common sub expression elimination.
30. How do you calculate the cost of an instruction?
31. List out the common issues in the design of code generator.
32. Give an example to show how DAG is used for register allocation.
33. Generate intermediate code for 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.
34. Explain the following with an example: a) Redundant sub expression elimination b) Frequency
reduction c) Copy propagation.
35. Optimize the following code using various optimization techniques: i=1; s=0;

for (i=1; i<=3; i++)


for (j=1;j<=3;j++)
c[i][j]=c[i][j] + a[i][j] + b[i][j]
36. Discuss and analyze all the allocation strategies in a run-time storage environment.
37. Write the algorithm for a simple code generator. And explain various issues that affect the
efficiency
of generated code.
38. Explain in brief about function preserving transformations on basic blocks.
39. Explain in brief about Induction variable elimination.
40. Describe the application of peephole? What kinds of peephole techniques can be used to perform
machine-dependent optimizations?

You might also like