[llvm-dev] unable to vectorize copy statement

Stephen Checkoway via llvm-dev llvm-dev at lists.llvm.org
Sat Nov 11 09:54:54 PST 2017


> On Nov 10, 2017, at 15:24, hameeza ahmed via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> 
> Hello,
> I am trying to vectorize copy statement in LLVM but unable to do so why? my code is follows:
> 
> int main()
> 
> {
> 
> int c[2048], a[2048];
> 
> for (int j=0; j<2048; j++)
> 
> 	  { a[j]=2;
>   c[j] = a[j];
> 
> }
> }
> 
> the command is follows:
> opt  -S -O3 -force-vector-width=64 s.ll -o s_o3.ll
> 
> how to do this?

This seems to work, although I'm not entirely sure about the -force-vector-width=64.

https://godbolt.org/g/oqzaHR


-- 
Stephen Checkoway





More information about the llvm-dev mailing list