MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

COMPILER DESIGN

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Replacing expensive operations with simpler ones is called
A
Strength reduction
B
Copy propagation
C
Constant folding
D
Dead code elimination
Explanation: 

Detailed explanation-1: -In software engineering, strength reduction is a compiler optimization where expensive operations are replaced with equivalent but less expensive operations.

Detailed explanation-2: -Strength reduction is an optimization technique which substitutes expensive operations with computationally cheaper ones. For example, a very weak strength reduction algorithm can substitute the instruction b = a * 4 with b = a « 2 .

Detailed explanation-3: -Explanation: Strength Reduction is a compiler optimization in which costly operations are replaced by cheaper ones. Example: Exponentiation is replaced by multiplication and multiplication is in return replaced by addition.

Detailed explanation-4: -Strength reduction : There are expressions that consume more CPU cycles, time, and memory. These expressions should be replaced with cheaper expressions without compromising the output of expression. For example, multiplication (x * 2) is expensive in terms of CPU cycles than (x « 1) and yields the same result.

Detailed explanation-5: -Strength reduction is an optimizations by which a compiler replaces expensive operations with less expensive ones that produce a functionally equivilant result.

There is 1 question to complete.