MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

COMPILER DESIGN

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Which one of the following is FALSE?
A
A basic block is a sequence of instructions where control enters the sequence at the beginning and exits at the end.
B
Available expression analysis can be used for common subexpression elimination
C
Live variable analysis can be used for dead code elimination.
D
x = 4 ∗ 5 => x = 20 is an example of common subexpression elimination
Explanation: 

Detailed explanation-1: -x = 4 × 5 ⇒ x = 20 ‘is an example of common subexpression elimination.] is False. is called the “constant folding” technique of compiler optimization.

Detailed explanation-2: -(D) x = 4 ∗ 5 => x = 20 is an example of common subexpression elimination. Explanation: (A) A basic block is a sequence of instructions where control enters the sequence at the beginning and exits at the end is TRUE.

Detailed explanation-3: -Common Sub-expression elimination. Dead code elimination. Code movement. Strength reduction.

Detailed explanation-4: -Common Subexpression Elimination is an optimization that searches for instances of identical expressions, and replaces them with a single variable holding the computed value.

Detailed explanation-5: -Dead code elimination is a compiler optimization to remove code which does not affect the program results. Live variable analysis is a classic data-flow analysis to calculate the variables that are live at each point in the program. Hence, is efficient for Dead code elimination.

There is 1 question to complete.