I am currently using icc (version 13.1.0.146) to compile C programs running in native mode on the Intel Xeon Phi coprocessor.
Consider the following two code fragments:
// fragment 1
array[pos] += 1;
array[pos + 1] += 1;
array[pos + 2] += 1;
array[pos + 3] += 1;
// fragment 2
for (int i = 0; i < 4; ++i)
array[i] += 1;
Unfortunately, only the loop is vectorized automatically. However, if i compile for the x86 platform, icc also vectorizes the "unrolled" version.
Is there a way to tell icc to vectorize basic blocks when compiling for the Xeon Phi, too?
Any help is appreciated. Thanks in advance!