RMK014: Unpredictable memory accesses in the loop body may prevent vectorization
Issue
Loop might not leverage SIMD vectorization because of the unpredictable memory accesses in the loop body.
Actions
Perform loop fission to isolate the unpredictable memory accesses to a separate loop. If not possible, consider evaluating the performance of the alternative scenarios described below.
Relevance
Memory access pattern is very important for good software performance. The loop contains unpredictable memory accesses (either because of dereferencing a pointer or because it accesses array elements indirectly). This type of memory access pattern is very inefficient from the memory subsystem perspective, and these loops are typically not good SIMD vectorization opportunities.
Occasionally, loops with unpredictable memory access pattern can benefit from vectorization: if the loop is computationally expensive, using loop fission to isolate the unpredictable accesses to a separate loop can help vectorize the remaining part of the loop. Alternatively, if the dataset the loop is processing is really small, the loop can benefit from explicit vectorization using compiler pragmas. Another idea: if the loop in question is a part of a loop nest, performing loop interchange or loop tiling can decrease the pressure on the memory subsystem as well.