Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Compiler Design

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

5CS4-02: Compiler Design

Q.1 Write short Answers


(i) Define peephole optimization
(ii) Mention the properties that a code generator should possess
(iii) What is a DAG? Mention its applications
(iv) What are the basic goals of code movement?.
(v) What are the different data flow properties?
(vi) Write difference between ‘Call by Value’ and ‘Call by Reference’

(vii) What is Basic block?

(viii) What is Control flow graph?

(ix) What is Activation Record? Explain its format.

(x) What is Symbol table?

(xi) Explain the storage allocation strategies.

(xii) Explain the flow graph with example.

(xiii) Explain the basic block with example.

(xiv) Explain the difference between stack allocation and heap allocation.

(xv) Explain the code motion with example.

Q.2 (i) What are the contents of activation record?


(ii) What are the different data flow properties?
(iii) What do you mean by machine dependent and machine independent
optimization.
(iv) (a)Differentiate between stack allocation and heap allocation (b) machine
idioms
(v) What are the basic goals of code movement
(vi) Explain the symbol table management system.
(vii) Explain all the issues of Source Language.
(viii) What is the difference between local and non local data? Explain with
example.
(ix) Construct the DAG and generate the code for given block
d: = b+c
e: = a*b
b: = b-c
a: = e*d
(x) Explain loop invariant computation by using LICM algorithm
(xi) Explain Peephole optimization with example
(xii) Write appropriate method for constructing a DAG for a basic block.
(xiii) Explain optimization of basic blocks.
(xiv) Explain general structure of an activation record.
(xv) Construct the DAG for the following block of statements:
a=b*c
d=b
e=d*c
b=e
f=b+c
g=f+d
(xvi) Explain principal source of code optimization.
(xvii) Explain loop invariant computation.

Q.3 (i)
Mention the issues to be considered while applying the techniques for code
optimization
(ii) Explain the various runtime storage management technique, with suitable
programming example
(iii) What do you understand by DAG? Write an algorithm for constructing a DAG

(iv) What is Calling sequence? Explain the process of calling sequence for a
procedure.

(v) Write an algorithm to divide a program into basic blocks with the help of
program code with example.

(vi) Explain the issues in Code generation technique?

(vii) Explain peephole optimization.

(viii) Explain the list data structure foe symbol tables.

(ix) Explain the symbol table management system.

You might also like