-
Which one of the following is FALSE?
-
- A basic block is a sequence of instructions where control enters the sequence at the beginning and exits at the end.
- Available expression analysis can be used for common subexpression elimination.
- Live variable analysis can be used for dead code elimination.
- x = 4 * 5 ⇒ x = 20 is an example of common subexpression elimination.
- A basic block is a sequence of instructions where control enters the sequence at the beginning and exits at the end.
Correct Option: D
The statement:–
x = 4 × 5 ⇒ x = 20 ‘is an example of common subexpression elimination.] is False.
Explanation :
Common Subexpression elimination is a compiter optimization that searches for instances of identical expressions (that evaluate to same value) and analyses whether it is worthwhile replacing them with a single variable holding the computed value. example:
Z1 = (x + y) + 1;
Z2 = (x + y) + b;
Z3 = (x + y) + c;
Above code segment may be transformed to: tmp = x + y;
Z1 = tmp + a;
Z2 = tmp + b;
Z3 = tmp + c;
So, the addition (x + y) is performed only once. It is worth noting that the given option (D)
x = 4 × 5 ⇒ x = 20
is called the “constant folding” technique of compiler optimization.