[cfe-users] clang/llvm fails to vectorize a simple fill loop

2019-02-04 Thread via cfe-users
Hi @all,

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

https://godbolt.org/z/hyZ2HO

Vectorization works for float, double and std::complex, but it fails for 
std::complex.
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

___
cfe-users mailing list
cfe-users@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users


Re: [cfe-users] clang/llvm fails to vectorize a simple fill loop

2019-02-04 Thread Matthew Fernandez via cfe-users

> On Feb 4, 2019, at 04:47, via cfe-users  wrote:
> 
> Hi @all,
> 
> can anyone tell me, what is wrong with the following loop in Fill:
> 
> https://godbolt.org/z/hyZ2HO
> 
> Vectorization works for float, double and std::complex, but it fails 
> for std::complex.
> 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.

Just a guess, but sizeof(std::complex) == 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.
___
cfe-users mailing list
cfe-users@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users