I am trying to optimise some code by use of AVX intrinsics. A very simple test case compiles but tells me that my loop was not vectorised for a number of reasons that I don't understand.
This is the full program, simple.c
#include <math.h>
#include <stdlib.h>
#include <assert.h>
#include <immintrin.h>
int main(void)
{
__m256 * x = (__m256 *) calloc(1024,sizeof(__m256));
for (int j=0;j<32;j++)
x[j] = _mm256_set1_ps(1.);
return(0);
}
This is the command line: gcc simple.c -O1 -fopenmp -ffast-math -lm -mavx2 -ftree-vectorize -fopt-info-vec-missed
This is the output:
- simple.c:11:3: note: not vectorized: unsupported data-type
- simple.c:11:3: note: can't determine vectorization factor.
- simple.c:6:5: note: not vectorized: not enough data-refs in basic block.
- simple.c:11:3: note: not vectorized: not enough data-refs in basic block.
- simple.c:6:5: note: not vectorized: not enough data-refs in basic block.
- simple.c:6:5: note: not vectorized: not enough data-refs in basic block.
I have gcc version 5.4.
Can anyone help me to interpret these messages and to understand what is going on?