I'm learning about vectorization and I don't know why this code is vectorized:
for (i=0; i<N; i++)
Y[i] = X[index [i]];
and this not:
for (i=0; i<N; i++)
X[index [i]]= Y[i];
I'm compiling with https://godbolt.org/ x86 gcc with -O3 option.
Why doesn't GCC auto-vectorize the scatter loop?