Monday, 18 May 2015

Q11.In compiler design ‘reducing the strength’ refers to


(A) reducing the range of values of input variables.
(B) code optimization using cheaper machine instructions.
(C) reducing efficiency of program.
(D) None of the above
Answer (B).
In software engineering, strength reduction is a compiler optimization technique where expensive operations are replaced with equivalent but less expensive operations. The classic example of strength reduction converts "strong" multiplications inside a loop into "weaker" additions – something that frequently occurs in array addressing. Examples of strength reduction include:
• replacing a multiplication within a loop with an addition
• replacing an exponentiation within a loop with a multiplication

1 comment:

Note: only a member of this blog may post a comment.