clang/llvm fails to vectorize a simple fill loop

Hi @all,

can anyone tell me, what is wrong with the following loop in Fill:

Vectorization works for float, double and std::complex<float>, but it fails for std::complex<double>.
The remark "read with atomic ordering or volatile read" hints for something, but neither do I know
exactly what, nor do I know how I can resolve the issue.

Best Olaf

Just a guess, but sizeof(std::complex<double>) == 16 on x86-64, so maybe something in the vectorization analysis decides (a) you can’t read a 16-byte value atomically with a SIMD instruction and (b) the source and destination may alias each other. This is sort of nonsensical because (b) is false and (a) shouldn’t factor into this decision. Maybe someone with more knowledge of the vectorizer can chime in.