LoopVectorizer: Handle strided memory accesses by versioning
authorArnold Schwaighofer <aschwaighofer@apple.com>
Fri, 10 Jan 2014 18:20:32 +0000 (18:20 +0000)
committerArnold Schwaighofer <aschwaighofer@apple.com>
Fri, 10 Jan 2014 18:20:32 +0000 (18:20 +0000)
commitee3f7de62e5616242441a76a8e92260d7b0f10e5
treea747ef919609000d0dbfca52d43e1bdcbbc341b3
parentdb81071b34eb4f5a9a27b4b5f8d32cc9f989db96
LoopVectorizer: Handle strided memory accesses by versioning

 for (i = 0; i < N; ++i)
   A[i * Stride1] += B[i * Stride2];

We take loops like this and check that the symbolic strides 'Strided1/2' are one
and drop to the scalar loop if they are not.

This is currently disabled by default and hidden behind the flag
'enable-mem-access-versioning'.

radar://13075509

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198950 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Vectorize/LoopVectorize.cpp
test/Transforms/LoopVectorize/runtime-check-readonly.ll
test/Transforms/LoopVectorize/version-mem-access.ll [new file with mode: 0644]