8.4. Loop Fusion

A loop fusion issue indicates that there are two loops iterating over the same data, but the accessed data is evicted from the cache between the loops. By moving the loops closer together or fusing them it may be possible to avoid the cache misses that the second loop now suffers from. See Section 5.2.3.2, “Loop Fusion” for a general description of loop fusion.

Loop Fusion Issue

Figure 8.6. Loop Fusion Issue


A loop fusion issue involves two loops. Since it is the second of the loops that will benefit from merging the loops, it is the statistics for the instruction group in that loop that are displayed.

The loop fusion issue contains some standard sections, instructions, loop statistics and loop instructions. However, since there are two loops involved you get one one of each for both of the two loops.

The loop fusion issue also contains a couple of sections pointing out potential barriers for fusing the loops. See Section 5.2.3.2, “Loop Fusion”.

In some cases a fusion opportunity is detected in a situation involving more than just two loops. These cases are normally ignored unless the report is prepared in expert mode. Typically these involve merging one or both of target loops' bodies with other loops. For these cases, the report includes sections that indicate the locations of these other loops. See Section 5.2.3.3, “Expert Loop Fusion”.