mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-03 11:24:18 +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:
@ -1101,6 +1101,10 @@ bool BoUpSLP::isFullyVectorizableTinyTree() {
|
|||||||
if (VectorizableTree.size() != 2)
|
if (VectorizableTree.size() != 2)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
// Handle splat stores.
|
||||||
|
if (!VectorizableTree[0].NeedToGather && isSplat(VectorizableTree[1].Scalars))
|
||||||
|
return true;
|
||||||
|
|
||||||
// Gathering cost would be too much for tiny trees.
|
// Gathering cost would be too much for tiny trees.
|
||||||
if (VectorizableTree[0].NeedToGather || VectorizableTree[1].NeedToGather)
|
if (VectorizableTree[0].NeedToGather || VectorizableTree[1].NeedToGather)
|
||||||
return false;
|
return false;
|
||||||
|
@ -138,3 +138,18 @@ for.body: ; preds = %entry, %for.body
|
|||||||
for.end: ; preds = %for.body, %entry
|
for.end: ; preds = %for.body, %entry
|
||||||
ret void
|
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
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user