diff options
-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 +} |