LoopVectorize: Vectorize all accesses in address space zero with unit stride
authorArnold Schwaighofer <aschwaighofer@apple.com>
Thu, 11 Jul 2013 15:21:55 +0000 (15:21 +0000)
committerArnold Schwaighofer <aschwaighofer@apple.com>
Thu, 11 Jul 2013 15:21:55 +0000 (15:21 +0000)
commit11eb51e23935e22e1cb7b346c45713e8c9169c84
tree5a2fd7b42be639e60baad696a2a46aae78f2ceb1
parent12fa02841ca1f2115d38aadd3e5d7afe08c65337
LoopVectorize: Vectorize all accesses in address space zero with unit stride

We can vectorize them because in the case where we wrap in the address space the
unvectorized code would have had to access a pointer value of zero which is
undefined behavior in address space zero according to the LLVM IR semantics.
(Thank you Duncan, for pointing this out to me).

Fixes PR16592.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186088 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Vectorize/LoopVectorize.cpp
test/Transforms/LoopVectorize/safegep.ll [new file with mode: 0644]