Diagnostic 15304: loop was not vectorized: non-vectorizable loop instance from multiversioning

By Anoop Madhusoodhanan Prabha,

Published:05/19/2014   Last Updated:05/19/2014

This diagnostic message is emitted from Intel(R) C++ Compiler 15.0 and above

Cause:

This diagnostic message is emitted when the compiler doesn't enough information from the code to create one version of the loop. Below is an example for this scenario. In this example, the compiler takes a defensive stand and generates both vectorized and non-vectorized version of this loop because the compiler assumes memory aliasing (the pointers could be pointing to overlapping memory locations).

Example:

void foo(float *a, float *b, float *c){ for(int i = 0 ; i < 256; i++)         c[i] = a[i] * b[i]; return; }

$ icpc test11.cc -c -qopt-report2 -qopt-report-phase=vec -qopt-report-file=stderr
Begin optimization report for: foo(float*, float*, float*)
    Report from: Vector optimizations [vec]
LOOP BEGIN at test11.cc(2,1)
<Peeled, Multiversioned v1>
LOOP END

LOOP BEGIN at test11.cc(2,1)
<Multiversioned v1>
   remark #15399: vectorization support: unroll factor set to 2
   remark #15300: LOOP WAS VECTORIZED
LOOP END

LOOP BEGIN at test11.cc(2,1)
<Multiversioned v1>
LOOP END

LOOP BEGIN at test11.cc(2,1)
<Remainder, Multiversioned v1>
   remark #15301: REMAINDER LOOP WAS VECTORIZED
LOOP END

LOOP BEGIN at test11.cc(2,1)
<Remainder, Multiversioned v1>
LOOP END

LOOP BEGIN at test11.cc(2,1)
<Multiversioned v2>
   remark #15304: loop was not vectorized: non-vectorizable loop instance from multiversioning
LOOP END

Resolution:

If you as a developer are certain that there is no memory aliasing, then use __restrict__ keywords to qualify the pointers passed as arguments as non-overlapping in memory.

Product and Performance Information

1

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.