[llvm] r274299 - LoadStoreVectorizer: Check skipFunction first.
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 30 16:50:18 PDT 2016
Author: arsenm
Date: Thu Jun 30 18:50:18 2016
New Revision: 274299
URL: http://llvm.org/viewvc/llvm-project?rev=274299&view=rev
Log:
LoadStoreVectorizer: Check skipFunction first.
Also add test I forgot to add to r274296.
Modified:
llvm/trunk/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp
llvm/trunk/test/Transforms/LoadStoreVectorizer/AMDGPU/optnone.ll
Modified: llvm/trunk/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp?rev=274299&r1=274298&r2=274299&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp (original)
+++ llvm/trunk/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp Thu Jun 30 18:50:18 2016
@@ -154,14 +154,14 @@ Pass *llvm::createLoadStoreVectorizerPas
}
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();
}
Modified: llvm/trunk/test/Transforms/LoadStoreVectorizer/AMDGPU/optnone.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoadStoreVectorizer/AMDGPU/optnone.ll?rev=274299&r1=274298&r2=274299&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/LoadStoreVectorizer/AMDGPU/optnone.ll (original)
+++ llvm/trunk/test/Transforms/LoadStoreVectorizer/AMDGPU/optnone.ll Thu Jun 30 18:50:18 2016
@@ -10,3 +10,13 @@ define void @optnone(i32 addrspace(1)* %
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
+}
More information about the llvm-commits
mailing list