Diagnostic 15028: loop was not vectorized: must preserve precise exceptions under given switches

Cause:

Vectorization imposes changes in the exception delivery order. But using -fp-model strict compiler option demands to preserve the such ordering and thus vectorization doesn't happen. Below is an example for this scenario:

Example:
 

void foo(float *restrict A, float *B, int n){
  int i;
  for 
(i=0;i<n;i++){
    if (A[i]>0){
      A[i] = 1/B[i];
    }  
}
}


$ icpc example27.cc -vec-report2 -c -restrict -fp-model strict
example27.cc(4): (col. 5) remark: loop was not vectorized: must preserve precise exceptions under given switches

Recommendation:

 Avoiding the compiler option -fp-model strict will vectorize this loop.

 

For more complete information about compiler optimizations, see our Optimization Notice.