File tree Expand file tree Collapse file tree 2 files changed +19
-4
lines changed
test/Transforms/SLPVectorizer/X86 Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -19697,10 +19697,18 @@ bool SLPVectorizerPass::vectorizeStores(
1969719697 Type *ValueTy = StoreTy;
1969819698 if (auto *Trunc = dyn_cast<TruncInst>(Store->getValueOperand()))
1969919699 ValueTy = Trunc->getSrcTy();
19700- unsigned MinVF = std::max<unsigned>(
19701- 2, PowerOf2Ceil(TTI->getStoreMinimumVF(
19702- R.getMinVF(DL->getTypeStoreSizeInBits(StoreTy)), StoreTy,
19703- ValueTy)));
19700+ // When REVEC is enabled, StoreTy and ValueTy may be FixedVectorType. But
19701+ // getStoreMinimumVF only support scalar type as arguments. As a result,
19702+ // we need to use the element type of StoreTy and ValueTy to retrieve the
19703+ // VF and then transform it back.
19704+ // Remember: VF is defined as the number we want to vectorize, not the
19705+ // number of elements in the final vector.
19706+ Type *StoreScalarTy = StoreTy->getScalarType();
19707+ unsigned MinVF = PowerOf2Ceil(TTI->getStoreMinimumVF(
19708+ R.getMinVF(DL->getTypeStoreSizeInBits(StoreScalarTy)), StoreScalarTy,
19709+ ValueTy->getScalarType()));
19710+ MinVF /= getNumElements(StoreTy);
19711+ MinVF = std::max<unsigned>(2, MinVF);
1970419712
1970519713 if (MaxVF < MinVF) {
1970619714 LLVM_DEBUG(dbgs() << "SLP: Vectorization infeasible as MaxVF (" << MaxVF
Original file line number Diff line number Diff line change 22; RUN: opt -mtriple=x86_64-unknown-linux-gnu -passes=slp-vectorizer -S -slp-revec %s | FileCheck %s
33
44define void @test () {
5+ ; CHECK-LABEL: @test(
6+ ; CHECK-NEXT: entry:
7+ ; CHECK-NEXT: [[TMP0:%.*]] = call <8 x i8> @llvm.vector.insert.v8i8.v4i8(<8 x i8> poison, <4 x i8> zeroinitializer, i64 0)
8+ ; CHECK-NEXT: [[TMP1:%.*]] = call <8 x i8> @llvm.vector.insert.v8i8.v4i8(<8 x i8> [[TMP0]], <4 x i8> zeroinitializer, i64 4)
9+ ; CHECK-NEXT: store <8 x i8> [[TMP1]], ptr null, align 1
10+ ; CHECK-NEXT: ret void
11+ ;
512entry:
613 %0 = getelementptr i8 , ptr null , i64 4
714 store <4 x i8 > zeroinitializer , ptr null , align 1
You can’t perform that action at this time.
0 commit comments