mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-20 14:29:27 +00:00
SLPVectorizer: Try vectorizing 'splat' stores
Vectorize sequential stores of a broadcasted value. 5% on eon. radar://16124699 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202067 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b55c398992
commit
68085c7bef
@ -1101,11 +1101,15 @@ bool BoUpSLP::isFullyVectorizableTinyTree() {
|
||||
if (VectorizableTree.size() != 2)
|
||||
return false;
|
||||
|
||||
// Gathering cost would be too much for tiny trees.
|
||||
if (VectorizableTree[0].NeedToGather || VectorizableTree[1].NeedToGather)
|
||||
return false;
|
||||
// Handle splat stores.
|
||||
if (!VectorizableTree[0].NeedToGather && isSplat(VectorizableTree[1].Scalars))
|
||||
return true;
|
||||
|
||||
return true;
|
||||
// Gathering cost would be too much for tiny trees.
|
||||
if (VectorizableTree[0].NeedToGather || VectorizableTree[1].NeedToGather)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
int BoUpSLP::getTreeCost() {
|
||||
|
@ -138,3 +138,18 @@ for.body: ; preds = %entry, %for.body
|
||||
for.end: ; preds = %for.body, %entry
|
||||
ret void
|
||||
}
|
||||
|
||||
|
||||
; CHECK-LABEL: store_splat
|
||||
; CHECK: store <4 x float>
|
||||
define void @store_splat(float*, float) {
|
||||
%3 = getelementptr inbounds float* %0, i64 0
|
||||
store float %1, float* %3, align 4
|
||||
%4 = getelementptr inbounds float* %0, i64 1
|
||||
store float %1, float* %4, align 4
|
||||
%5 = getelementptr inbounds float* %0, i64 2
|
||||
store float %1, float* %5, align 4
|
||||
%6 = getelementptr inbounds float* %0, i64 3
|
||||
store float %1, float* %6, align 4
|
||||
ret void
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user