diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2016-06-30 23:50:18 +0000 |
---|---|---|
committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2016-06-30 23:50:18 +0000 |
commit | 079d0f19a2878d772aef79ca5d471bb514c52781 (patch) | |
tree | 3ded064e348f22f0d881b2b5118eb8bb898ab7fb | |
parent | c73850c702370e35b312ceea7d3ca5c44473182f (diff) | |
download | bcm5719-llvm-079d0f19a2878d772aef79ca5d471bb514c52781.tar.gz bcm5719-llvm-079d0f19a2878d772aef79ca5d471bb514c52781.zip |
LoadStoreVectorizer: Check skipFunction first.
Also add test I forgot to add to r274296.
llvm-svn: 274299
-rw-r--r-- | llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp | 8 | ||||
-rw-r--r-- | llvm/test/Transforms/LoadStoreVectorizer/AMDGPU/optnone.ll | 10 |
2 files changed, 14 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp b/llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp index 880be650ef3..567e8e6eb1d 100644 --- a/llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp +++ b/llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp @@ -154,14 +154,14 @@ Pass *llvm::createLoadStoreVectorizerPass(unsigned VecRegSize) { } bool LoadStoreVectorizer::runOnFunction(Function &F) { + // Don't vectorize when the attribute NoImplicitFloat is used. + if (skipFunction(F) || F.hasFnAttribute(Attribute::NoImplicitFloat)) + return false; + AliasAnalysis &AA = getAnalysis<AAResultsWrapperPass>().getAAResults(); DominatorTree &DT = getAnalysis<DominatorTreeWrapperPass>().getDomTree(); ScalarEvolution &SE = getAnalysis<ScalarEvolutionWrapperPass>().getSE(); - // Don't vectorize when the attribute NoImplicitFloat is used. - if (F.hasFnAttribute(Attribute::NoImplicitFloat) || skipFunction(F)) - return false; - Vectorizer V(F, AA, DT, SE, VecRegSize); return V.run(); } diff --git a/llvm/test/Transforms/LoadStoreVectorizer/AMDGPU/optnone.ll b/llvm/test/Transforms/LoadStoreVectorizer/AMDGPU/optnone.ll index 42166f9986b..141e20a1f83 100644 --- a/llvm/test/Transforms/LoadStoreVectorizer/AMDGPU/optnone.ll +++ b/llvm/test/Transforms/LoadStoreVectorizer/AMDGPU/optnone.ll @@ -10,3 +10,13 @@ define void @optnone(i32 addrspace(1)* %out) noinline optnone { store i32 456, i32 addrspace(1)* %out ret void } + +; CHECK-LABEL: @do_opt( +; CHECK: store <2 x i32> +define void @do_opt(i32 addrspace(1)* %out) { + %out.gep.1 = getelementptr i32, i32 addrspace(1)* %out, i32 1 + + store i32 123, i32 addrspace(1)* %out.gep.1 + store i32 456, i32 addrspace(1)* %out + ret void +} |