Code Optimization
1.

Optimization can be categorized broadly into ____ types.

A.  

2

B.  

3

C.  

4

D.  

5

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

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

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

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

6.

Peep-hole optimization is a form of 

A.  

loop optimization

B.  

local optimization

C.  

data flow analysis

D.  

constant folding

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

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

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

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