COMPUTER SCIENCE AND ENGINEERING
COMPILER DESIGN
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
Loop rolling
|
|
Loop jamming
|
|
Constant folding
|
|
None of these
|
Detailed explanation-1: -2. The method which merges the bodies of two loops is? Explanation: In computer science, loop fusion (or loop jamming) is a compiler optimization and loop transformation which replaces multiple loops with a single one.
Detailed explanation-2: -Explanation: The merging of the bodies of two loops is called loop jamming.
Detailed explanation-3: -Loop jamming refers to carrying out operations in one loop rather than in two or more. This is illustrated by the example below.
Detailed explanation-4: -Loop fission is the opposite of loop fusion: a loop is split into two or more loops. This optimization is appropriate if the number of computations in a loop becomes excessive, leading to register spills that degrade performance. Loop fission can also come into play if a loop contains conditional statements.
Detailed explanation-5: -Loop fusion is where two apparently independent loops run over an intersecting range. For example, loop 1 runs from 0 to 100 and loop 2 from 0 to 200. The code for loop 2 can be fused with the code for loop 1, for at least the first 100 iterations.