You copied the Doc URL to your clipboard.

Grouping structure accesses for vectorization

Writing loops to use all parts of a structure together is important for vectorization. Each part of the structure must be accessed within the same loop.

The following examples show how loop organization can affect vectorization.

Structure access resulting in a nonvectorizable loop:

for (...) { buffer[i].a = ....; }
for (...) { buffer[i].b = ....; }
for (...) { buffer[i].c = ....; }

Structure access resulting in a vectorizable loop

for (...)
{
    buffer[i].a = ....;
    buffer[i].b = ....;
    buffer[i].c = ....;
}