Diagnostic 15135: vectorization support: vectorization of this loop under -Os has impact on code size

Cause:

Compiler option -Os when specified, the compiler tries to limit the code size growth. Here the loop hits the -Os heuristic of the vectorizer and thus emits a vectorization diagnostic "loop was not vectorized: possible but seems inefficient". When the user demands for more information on this using -vec-report6, this specific information of impact on code size is emitted by the compiler. Vectorizing a loop involves generation of vector operands which needs some extra piece of code. Below is an example for this scenario:

Example:

void foo(unsigned int *a, double *b, int n){
  int i;
#pragma ivdep  
for (i=0; i<n; i++){
    a[i] = b[i];
  }
}


$ icc size.c -c -vec-report6 -Os
size.c(5): (col. 5) remark: vectorization support: reference a has unaligned access
size.c(5): (col. 5) remark: vectorization support: reference b has unaligned access
size.c(5): (col. 5) remark: vectorization support: unaligned access used inside loop body
size.c(4): (col. 3) remark: vectorization support: vectorization of this loop under -Os has impact on code size
size.c(4): (col. 3) remark: loop was not vectorized: vectorization possible but seems inefficient
size.c(5): (col. 12) remark: vectorization support: conversion from float to int will be emulated

Resolution:

If we can comprimise on the code size for this application, then avoiding the -Os compiler option will vectorize this loop.

 

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