In _______, the bodies of the two loops are merged together to form a single loop provided that they do…
Loop jamming (also called loop fusion) merges the bodies of two adjacent loops that run over the same index range into a single loop, which is safe when neither body uses…
Choose your answer
In _______, the bodies of the two loops are merged together to form a single loop provided that they do not make any references to each other.
Answer and explanation
Correct answer D
Loop jamming (also called loop fusion) merges the bodies of two adjacent loops that run over the same index range into a single loop, which is safe when neither body uses values computed by the other. It saves the cost of testing and incrementing a second loop counter. Loop unrolling instead repeats the body to cut down the number of iterations, and strength reduction replaces a costly operation such as multiplication with a cheaper one such as addition.
Practice for these exams
-
UGC NET Computer Science and Applications