Diagnostic 15315: xxxx was not vectorized: low trip count

Cause:

By default SSE2 achitecture can fit in 16 characters in one  XMM register as a part of vectorization. But in the given example the number of character packed in the XMM register will be 15 and thus compiler heuristics reports that the trip count is low. In general the vectorizer tries to vectorize those loops where it can fit at least one full vector. Below is an example for this scenario.


Example:

#define TTT char
TTT A[15];
TTT foo(int n){
  TTT sum=0;
  int i;
  for (i=0;i<n;i++){
    sum+=A[i];
  }
  return sum;
}


$ icpc example23.c -vec-report6 -c
example23.c(7): (col. 5) remark: vectorization support: reference A has aligned access
example23.c(6): (col. 3) remark: loop was not vectorized: low trip count

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