Compiler Design MCQ Questions And Answers - Code Optimization

This section focuses on "Code Optimization" in Compiler Design. These Multiple Choice Questions (MCQ) should be practiced to improve the Compiler Design skills required for various interviews (campus interviews, walk-in interviews, company interviews), placements, entrance exams and other competitive examinations.

1. Optimization can be categorized broadly into ____ types.

A. 2
B. 3
C. 4
D. 5

View Answer


2. A fragment of code that resides in the loop and computes the same value at each iteration is called a?

A. Induction analysis
B. Strength reduction
C. loop-invariant code
D. None of the above

View Answer


3. A variable is called an _________ variable if its value is altered within the loop by a loop-invariant value.

A. Invariant 
B. induction
C. strength 
D. loop

View Answer


4. Dead code plays no role in any program operation and therefore it can simply be eliminated.

A. TRUE
B. FALSE
C. Can be true or false
D. Can not say

View Answer


5. Substitution of values for names whose values are constant, is done in

A. local optimization
B. loop optimization
C. constant folding
D. None of the above

View Answer


6. Peep-hole optimization is a form of 

A. loop optimization
B. local optimization
C. data flow analysis
D. constant folding 

View Answer


7. In analyzing the compilation of PL/I program, the term Machine independent optimization is assosiated with

A. creation of more optical matrix
B. recognition of basic elements and creation of uniform symbols
C. recognization of basic syntactic construction through reductionsc
D. use of macro-processor to produce more optimal assembly code

View Answer


8. Before generating intermediate code, the compiler can modify the intermediate code by address calculations and improving loops.

A. TRUE
B. FALSE
C. Can be true or false
D. Can not say

View Answer


9. The compiler can make use of memory hierarchy and CPU registers.

A. TRUE
B. FALSE
C. Can be true or false
D. Can not say

View Answer


10. A compiler for a high-level language that runs on one machine and produces code for a different machine is called

A. optimizing compiler
B. one pass compiler
C. cross compiler
D. multipass compiler

View Answer





Discussion



* You must be logged in to add comment.