diff --git a/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp b/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp index 9b91de36a688a..2232e5fd6f164 100644 --- a/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp +++ b/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp @@ -383,6 +383,62 @@ static VectorType *getVRGatherIndexType(MVT DataVT, const RISCVSubtarget &ST, return cast(EVT(IndexVT).getTypeForEVT(C)); } +/// Attempt to approximate the cost of a shuffle which will require splitting +/// during legalization. Note that processShuffleMasks is not an exact proxy +/// for the algorithm used in LegalizeVectorTypes, but hopefully it's a +/// reasonably close upperbound. +static InstructionCost costShuffleViaSplitting(RISCVTTIImpl &TTI, MVT LegalVT, + VectorType *Tp, + ArrayRef Mask, + TTI::TargetCostKind CostKind) { + assert(LegalVT.isFixedLengthVector() && !Mask.empty() && + "Expected fixed vector type and non-empty mask"); + unsigned LegalNumElts = LegalVT.getVectorNumElements(); + // Number of destination vectors after legalization: + unsigned NumOfDests = divideCeil(Mask.size(), LegalNumElts); + // We are going to permute multiple sources and the result will be in + // multiple destinations. Providing an accurate cost only for splits where + // the element type remains the same. + if (NumOfDests <= 1 || + LegalVT.getVectorElementType().getSizeInBits() != + Tp->getElementType()->getPrimitiveSizeInBits() || + LegalNumElts >= Tp->getElementCount().getFixedValue()) + return InstructionCost::getInvalid(); + + unsigned VecTySize = TTI.getDataLayout().getTypeStoreSize(Tp); + unsigned LegalVTSize = LegalVT.getStoreSize(); + // Number of source vectors after legalization: + unsigned NumOfSrcs = divideCeil(VecTySize, LegalVTSize); + + auto *SingleOpTy = FixedVectorType::get(Tp->getElementType(), LegalNumElts); + + unsigned NormalizedVF = LegalNumElts * std::max(NumOfSrcs, NumOfDests); + unsigned NumOfSrcRegs = NormalizedVF / LegalNumElts; + unsigned NumOfDestRegs = NormalizedVF / LegalNumElts; + SmallVector NormalizedMask(NormalizedVF, PoisonMaskElem); + assert(NormalizedVF >= Mask.size() && + "Normalized mask expected to be not shorter than original mask."); + copy(Mask, NormalizedMask.begin()); + InstructionCost Cost = 0; + SmallDenseSet, unsigned>> ReusedSingleSrcShuffles; + processShuffleMasks( + NormalizedMask, NumOfSrcRegs, NumOfDestRegs, NumOfDestRegs, []() {}, + [&](ArrayRef RegMask, unsigned SrcReg, unsigned DestReg) { + if (ShuffleVectorInst::isIdentityMask(RegMask, RegMask.size())) + return; + if (!ReusedSingleSrcShuffles.insert(std::make_pair(RegMask, SrcReg)) + .second) + return; + Cost += TTI.getShuffleCost(TTI::SK_PermuteSingleSrc, SingleOpTy, + RegMask, CostKind, 0, nullptr); + }, + [&](ArrayRef RegMask, unsigned Idx1, unsigned Idx2, bool NewReg) { + Cost += TTI.getShuffleCost(TTI::SK_PermuteTwoSrc, SingleOpTy, RegMask, + CostKind, 0, nullptr); + }); + return Cost; +} + /// Try to perform better estimation of the permutation. /// 1. Split the source/destination vectors into real registers. /// 2. Do the mask analysis to identify which real registers are @@ -645,48 +701,13 @@ InstructionCost RISCVTTIImpl::getShuffleCost(TTI::ShuffleKind Kind, return true; } }; - // We are going to permute multiple sources and the result will be in - // multiple destinations. Providing an accurate cost only for splits where - // the element type remains the same. + if (!Mask.empty() && LT.first.isValid() && LT.first != 1 && - shouldSplit(Kind) && - LT.second.getVectorElementType().getSizeInBits() == - Tp->getElementType()->getPrimitiveSizeInBits() && - LT.second.getVectorNumElements() < - cast(Tp)->getNumElements() && - divideCeil(Mask.size(), - cast(Tp)->getNumElements()) == - static_cast(*LT.first.getValue())) { - unsigned NumRegs = *LT.first.getValue(); - unsigned VF = cast(Tp)->getNumElements(); - unsigned SubVF = PowerOf2Ceil(VF / NumRegs); - auto *SubVecTy = FixedVectorType::get(Tp->getElementType(), SubVF); - - InstructionCost Cost = 0; - for (unsigned I = 0, NumSrcRegs = divideCeil(Mask.size(), SubVF); - I < NumSrcRegs; ++I) { - bool IsSingleVector = true; - SmallVector SubMask(SubVF, PoisonMaskElem); - transform( - Mask.slice(I * SubVF, - I == NumSrcRegs - 1 ? Mask.size() % SubVF : SubVF), - SubMask.begin(), [&](int I) -> int { - if (I == PoisonMaskElem) - return PoisonMaskElem; - bool SingleSubVector = I / VF == 0; - IsSingleVector &= SingleSubVector; - return (SingleSubVector ? 0 : 1) * SubVF + (I % VF) % SubVF; - }); - if (all_of(enumerate(SubMask), [](auto &&P) { - return P.value() == PoisonMaskElem || - static_cast(P.value()) == P.index(); - })) - continue; - Cost += getShuffleCost(IsSingleVector ? TTI::SK_PermuteSingleSrc - : TTI::SK_PermuteTwoSrc, - SubVecTy, SubMask, CostKind, 0, nullptr); - } - return Cost; + shouldSplit(Kind)) { + InstructionCost SplitCost = + costShuffleViaSplitting(*this, LT.second, FVTp, Mask, CostKind); + if (SplitCost.isValid()) + return SplitCost; } } diff --git a/llvm/test/Analysis/CostModel/RISCV/shuffle-exact-vlen.ll b/llvm/test/Analysis/CostModel/RISCV/shuffle-exact-vlen.ll index 23d5999237e30..b73abbfeba084 100644 --- a/llvm/test/Analysis/CostModel/RISCV/shuffle-exact-vlen.ll +++ b/llvm/test/Analysis/CostModel/RISCV/shuffle-exact-vlen.ll @@ -6,11 +6,11 @@ define <64 x i32> @interleave_v32i32(<32 x i32> %x, <32 x i32> %y) vscale_range(2,2) { ; CHECK-LABEL: 'interleave_v32i32' -; CHECK-NEXT: Cost Model: Found an estimated cost of 224 for instruction: %a = shufflevector <32 x i32> %x, <32 x i32> %y, <64 x i32> +; CHECK-NEXT: Cost Model: Found an estimated cost of 302 for instruction: %a = shufflevector <32 x i32> %x, <32 x i32> %y, <64 x i32> ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i32> %a ; ; CHECK-SIZE-LABEL: 'interleave_v32i32' -; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 224 for instruction: %a = shufflevector <32 x i32> %x, <32 x i32> %y, <64 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %a = shufflevector <32 x i32> %x, <32 x i32> %y, <64 x i32> ; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i32> %a ; %a = shufflevector <32 x i32> %x, <32 x i32> %y, <64 x i32> @@ -319,7 +319,7 @@ define void @shuffle1() vscale_range(2,2) { ; RV32-NEXT: Cost Model: Found an estimated cost of 68 for instruction: %zipv8i64 = shufflevector <8 x i64> poison, <8 x i64> poison, <16 x i32> ; RV32-NEXT: Cost Model: Found an estimated cost of 139 for instruction: %zip1v16i64 = shufflevector <16 x i64> poison, <16 x i64> poison, <16 x i32> ; RV32-NEXT: Cost Model: Found an estimated cost of 139 for instruction: %zip2v16i64 = shufflevector <16 x i64> poison, <16 x i64> poison, <16 x i32> -; RV32-NEXT: Cost Model: Found an estimated cost of 256 for instruction: %zipv16i64 = shufflevector <16 x i64> poison, <16 x i64> poison, <32 x i32> +; RV32-NEXT: Cost Model: Found an estimated cost of 278 for instruction: %zipv16i64 = shufflevector <16 x i64> poison, <16 x i64> poison, <32 x i32> ; RV32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void ; ; RV64-LABEL: 'shuffle1' @@ -370,110 +370,59 @@ define void @shuffle1() vscale_range(2,2) { ; RV64-NEXT: Cost Model: Found an estimated cost of 74 for instruction: %zipv8i64 = shufflevector <8 x i64> poison, <8 x i64> poison, <16 x i32> ; RV64-NEXT: Cost Model: Found an estimated cost of 151 for instruction: %zip1v16i64 = shufflevector <16 x i64> poison, <16 x i64> poison, <16 x i32> ; RV64-NEXT: Cost Model: Found an estimated cost of 151 for instruction: %zip2v16i64 = shufflevector <16 x i64> poison, <16 x i64> poison, <16 x i32> -; RV64-NEXT: Cost Model: Found an estimated cost of 96 for instruction: %zipv16i64 = shufflevector <16 x i64> poison, <16 x i64> poison, <32 x i32> +; RV64-NEXT: Cost Model: Found an estimated cost of 302 for instruction: %zipv16i64 = shufflevector <16 x i64> poison, <16 x i64> poison, <32 x i32> ; RV64-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void ; -; RV32-SIZE-LABEL: 'shuffle1' -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip1v2i8 = shufflevector <2 x i8> poison, <2 x i8> poison, <2 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip2v2i8 = shufflevector <2 x i8> poison, <2 x i8> poison, <2 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %zipv2i8 = shufflevector <2 x i8> poison, <2 x i8> poison, <4 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip1v4i8 = shufflevector <4 x i8> poison, <4 x i8> poison, <4 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip2v4i8 = shufflevector <4 x i8> poison, <4 x i8> poison, <4 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %zipv4i8 = shufflevector <4 x i8> poison, <4 x i8> poison, <8 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip1v8i8 = shufflevector <8 x i8> poison, <8 x i8> poison, <8 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip2v8i8 = shufflevector <8 x i8> poison, <8 x i8> poison, <8 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %zipv8i8 = shufflevector <8 x i8> poison, <8 x i8> poison, <16 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip1v16i8 = shufflevector <16 x i8> poison, <16 x i8> poison, <16 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip2v16i8 = shufflevector <16 x i8> poison, <16 x i8> poison, <16 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %zipv16i8 = shufflevector <16 x i8> poison, <16 x i8> poison, <32 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip1v2i16 = shufflevector <2 x i16> poison, <2 x i16> poison, <2 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip2v2i16 = shufflevector <2 x i16> poison, <2 x i16> poison, <2 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %zipv2i16 = shufflevector <2 x i16> poison, <2 x i16> poison, <4 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip1v4i16 = shufflevector <4 x i16> poison, <4 x i16> poison, <4 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip2v4i16 = shufflevector <4 x i16> poison, <4 x i16> poison, <4 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %zipv4i16 = shufflevector <4 x i16> poison, <4 x i16> poison, <8 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip1v8i16 = shufflevector <8 x i16> poison, <8 x i16> poison, <8 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip2v8i16 = shufflevector <8 x i16> poison, <8 x i16> poison, <8 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %zipv8i16 = shufflevector <8 x i16> poison, <8 x i16> poison, <16 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip1v16i16 = shufflevector <16 x i16> poison, <16 x i16> poison, <16 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip2v16i16 = shufflevector <16 x i16> poison, <16 x i16> poison, <16 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %zipv16i16 = shufflevector <16 x i16> poison, <16 x i16> poison, <32 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip1v2i32 = shufflevector <2 x i32> poison, <2 x i32> poison, <2 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip2v2i32 = shufflevector <2 x i32> poison, <2 x i32> poison, <2 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %zipv2i32 = shufflevector <2 x i32> poison, <2 x i32> poison, <4 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip1v4i32 = shufflevector <4 x i32> poison, <4 x i32> poison, <4 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip2v4i32 = shufflevector <4 x i32> poison, <4 x i32> poison, <4 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %zipv4i32 = shufflevector <4 x i32> poison, <4 x i32> poison, <8 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip1v8i32 = shufflevector <8 x i32> poison, <8 x i32> poison, <8 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip2v8i32 = shufflevector <8 x i32> poison, <8 x i32> poison, <8 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %zipv8i32 = shufflevector <8 x i32> poison, <8 x i32> poison, <16 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip1v16i32 = shufflevector <16 x i32> poison, <16 x i32> poison, <16 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip2v16i32 = shufflevector <16 x i32> poison, <16 x i32> poison, <16 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %zipv16i32 = shufflevector <16 x i32> poison, <16 x i32> poison, <32 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip1v2i64 = shufflevector <2 x i64> poison, <2 x i64> poison, <2 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip2v2i64 = shufflevector <2 x i64> poison, <2 x i64> poison, <2 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %zipv2i64 = shufflevector <2 x i64> poison, <2 x i64> poison, <4 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip1v4i64 = shufflevector <4 x i64> poison, <4 x i64> poison, <4 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip2v4i64 = shufflevector <4 x i64> poison, <4 x i64> poison, <4 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %zipv4i64 = shufflevector <4 x i64> poison, <4 x i64> poison, <8 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip1v8i64 = shufflevector <8 x i64> poison, <8 x i64> poison, <8 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip2v8i64 = shufflevector <8 x i64> poison, <8 x i64> poison, <8 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %zipv8i64 = shufflevector <8 x i64> poison, <8 x i64> poison, <16 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip1v16i64 = shufflevector <16 x i64> poison, <16 x i64> poison, <16 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip2v16i64 = shufflevector <16 x i64> poison, <16 x i64> poison, <16 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 256 for instruction: %zipv16i64 = shufflevector <16 x i64> poison, <16 x i64> poison, <32 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void -; -; RV64-SIZE-LABEL: 'shuffle1' -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip1v2i8 = shufflevector <2 x i8> poison, <2 x i8> poison, <2 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip2v2i8 = shufflevector <2 x i8> poison, <2 x i8> poison, <2 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %zipv2i8 = shufflevector <2 x i8> poison, <2 x i8> poison, <4 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip1v4i8 = shufflevector <4 x i8> poison, <4 x i8> poison, <4 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip2v4i8 = shufflevector <4 x i8> poison, <4 x i8> poison, <4 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %zipv4i8 = shufflevector <4 x i8> poison, <4 x i8> poison, <8 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip1v8i8 = shufflevector <8 x i8> poison, <8 x i8> poison, <8 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip2v8i8 = shufflevector <8 x i8> poison, <8 x i8> poison, <8 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %zipv8i8 = shufflevector <8 x i8> poison, <8 x i8> poison, <16 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip1v16i8 = shufflevector <16 x i8> poison, <16 x i8> poison, <16 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip2v16i8 = shufflevector <16 x i8> poison, <16 x i8> poison, <16 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %zipv16i8 = shufflevector <16 x i8> poison, <16 x i8> poison, <32 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip1v2i16 = shufflevector <2 x i16> poison, <2 x i16> poison, <2 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip2v2i16 = shufflevector <2 x i16> poison, <2 x i16> poison, <2 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %zipv2i16 = shufflevector <2 x i16> poison, <2 x i16> poison, <4 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip1v4i16 = shufflevector <4 x i16> poison, <4 x i16> poison, <4 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip2v4i16 = shufflevector <4 x i16> poison, <4 x i16> poison, <4 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %zipv4i16 = shufflevector <4 x i16> poison, <4 x i16> poison, <8 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip1v8i16 = shufflevector <8 x i16> poison, <8 x i16> poison, <8 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip2v8i16 = shufflevector <8 x i16> poison, <8 x i16> poison, <8 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %zipv8i16 = shufflevector <8 x i16> poison, <8 x i16> poison, <16 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip1v16i16 = shufflevector <16 x i16> poison, <16 x i16> poison, <16 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip2v16i16 = shufflevector <16 x i16> poison, <16 x i16> poison, <16 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %zipv16i16 = shufflevector <16 x i16> poison, <16 x i16> poison, <32 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip1v2i32 = shufflevector <2 x i32> poison, <2 x i32> poison, <2 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip2v2i32 = shufflevector <2 x i32> poison, <2 x i32> poison, <2 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %zipv2i32 = shufflevector <2 x i32> poison, <2 x i32> poison, <4 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip1v4i32 = shufflevector <4 x i32> poison, <4 x i32> poison, <4 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip2v4i32 = shufflevector <4 x i32> poison, <4 x i32> poison, <4 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %zipv4i32 = shufflevector <4 x i32> poison, <4 x i32> poison, <8 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip1v8i32 = shufflevector <8 x i32> poison, <8 x i32> poison, <8 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip2v8i32 = shufflevector <8 x i32> poison, <8 x i32> poison, <8 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %zipv8i32 = shufflevector <8 x i32> poison, <8 x i32> poison, <16 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip1v16i32 = shufflevector <16 x i32> poison, <16 x i32> poison, <16 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip2v16i32 = shufflevector <16 x i32> poison, <16 x i32> poison, <16 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %zipv16i32 = shufflevector <16 x i32> poison, <16 x i32> poison, <32 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip1v2i64 = shufflevector <2 x i64> poison, <2 x i64> poison, <2 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip2v2i64 = shufflevector <2 x i64> poison, <2 x i64> poison, <2 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %zipv2i64 = shufflevector <2 x i64> poison, <2 x i64> poison, <4 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip1v4i64 = shufflevector <4 x i64> poison, <4 x i64> poison, <4 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip2v4i64 = shufflevector <4 x i64> poison, <4 x i64> poison, <4 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %zipv4i64 = shufflevector <4 x i64> poison, <4 x i64> poison, <8 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip1v8i64 = shufflevector <8 x i64> poison, <8 x i64> poison, <8 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip2v8i64 = shufflevector <8 x i64> poison, <8 x i64> poison, <8 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %zipv8i64 = shufflevector <8 x i64> poison, <8 x i64> poison, <16 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip1v16i64 = shufflevector <16 x i64> poison, <16 x i64> poison, <16 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip2v16i64 = shufflevector <16 x i64> poison, <16 x i64> poison, <16 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 96 for instruction: %zipv16i64 = shufflevector <16 x i64> poison, <16 x i64> poison, <32 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void +; CHECK-SIZE-LABEL: 'shuffle1' +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip1v2i8 = shufflevector <2 x i8> poison, <2 x i8> poison, <2 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip2v2i8 = shufflevector <2 x i8> poison, <2 x i8> poison, <2 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %zipv2i8 = shufflevector <2 x i8> poison, <2 x i8> poison, <4 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip1v4i8 = shufflevector <4 x i8> poison, <4 x i8> poison, <4 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip2v4i8 = shufflevector <4 x i8> poison, <4 x i8> poison, <4 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %zipv4i8 = shufflevector <4 x i8> poison, <4 x i8> poison, <8 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip1v8i8 = shufflevector <8 x i8> poison, <8 x i8> poison, <8 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip2v8i8 = shufflevector <8 x i8> poison, <8 x i8> poison, <8 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %zipv8i8 = shufflevector <8 x i8> poison, <8 x i8> poison, <16 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip1v16i8 = shufflevector <16 x i8> poison, <16 x i8> poison, <16 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip2v16i8 = shufflevector <16 x i8> poison, <16 x i8> poison, <16 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %zipv16i8 = shufflevector <16 x i8> poison, <16 x i8> poison, <32 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip1v2i16 = shufflevector <2 x i16> poison, <2 x i16> poison, <2 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip2v2i16 = shufflevector <2 x i16> poison, <2 x i16> poison, <2 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %zipv2i16 = shufflevector <2 x i16> poison, <2 x i16> poison, <4 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip1v4i16 = shufflevector <4 x i16> poison, <4 x i16> poison, <4 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip2v4i16 = shufflevector <4 x i16> poison, <4 x i16> poison, <4 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %zipv4i16 = shufflevector <4 x i16> poison, <4 x i16> poison, <8 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip1v8i16 = shufflevector <8 x i16> poison, <8 x i16> poison, <8 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip2v8i16 = shufflevector <8 x i16> poison, <8 x i16> poison, <8 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %zipv8i16 = shufflevector <8 x i16> poison, <8 x i16> poison, <16 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip1v16i16 = shufflevector <16 x i16> poison, <16 x i16> poison, <16 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip2v16i16 = shufflevector <16 x i16> poison, <16 x i16> poison, <16 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %zipv16i16 = shufflevector <16 x i16> poison, <16 x i16> poison, <32 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip1v2i32 = shufflevector <2 x i32> poison, <2 x i32> poison, <2 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip2v2i32 = shufflevector <2 x i32> poison, <2 x i32> poison, <2 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %zipv2i32 = shufflevector <2 x i32> poison, <2 x i32> poison, <4 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip1v4i32 = shufflevector <4 x i32> poison, <4 x i32> poison, <4 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip2v4i32 = shufflevector <4 x i32> poison, <4 x i32> poison, <4 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %zipv4i32 = shufflevector <4 x i32> poison, <4 x i32> poison, <8 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip1v8i32 = shufflevector <8 x i32> poison, <8 x i32> poison, <8 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip2v8i32 = shufflevector <8 x i32> poison, <8 x i32> poison, <8 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %zipv8i32 = shufflevector <8 x i32> poison, <8 x i32> poison, <16 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip1v16i32 = shufflevector <16 x i32> poison, <16 x i32> poison, <16 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip2v16i32 = shufflevector <16 x i32> poison, <16 x i32> poison, <16 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %zipv16i32 = shufflevector <16 x i32> poison, <16 x i32> poison, <32 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip1v2i64 = shufflevector <2 x i64> poison, <2 x i64> poison, <2 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip2v2i64 = shufflevector <2 x i64> poison, <2 x i64> poison, <2 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %zipv2i64 = shufflevector <2 x i64> poison, <2 x i64> poison, <4 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip1v4i64 = shufflevector <4 x i64> poison, <4 x i64> poison, <4 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip2v4i64 = shufflevector <4 x i64> poison, <4 x i64> poison, <4 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %zipv4i64 = shufflevector <4 x i64> poison, <4 x i64> poison, <8 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip1v8i64 = shufflevector <8 x i64> poison, <8 x i64> poison, <8 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip2v8i64 = shufflevector <8 x i64> poison, <8 x i64> poison, <8 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %zipv8i64 = shufflevector <8 x i64> poison, <8 x i64> poison, <16 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip1v16i64 = shufflevector <16 x i64> poison, <16 x i64> poison, <16 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %zip2v16i64 = shufflevector <16 x i64> poison, <16 x i64> poison, <16 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %zipv16i64 = shufflevector <16 x i64> poison, <16 x i64> poison, <32 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void ; %zip1v2i8 = shufflevector <2 x i8> poison, <2 x i8> poison, <2 x i32> %zip2v2i8 = shufflevector <2 x i8> poison, <2 x i8> poison, <2 x i32> @@ -567,7 +516,7 @@ define void @shuffle2() vscale_range(2,2) { ; RV32-NEXT: Cost Model: Found an estimated cost of 68 for instruction: %uzpv8i64 = shufflevector <8 x i64> poison, <8 x i64> poison, <16 x i32> ; RV32-NEXT: Cost Model: Found an estimated cost of 139 for instruction: %uzp1v16i64 = shufflevector <16 x i64> poison, <16 x i64> poison, <16 x i32> ; RV32-NEXT: Cost Model: Found an estimated cost of 139 for instruction: %uzp2v16i64 = shufflevector <16 x i64> poison, <16 x i64> poison, <16 x i32> -; RV32-NEXT: Cost Model: Found an estimated cost of 256 for instruction: %uzpv16i64 = shufflevector <16 x i64> poison, <16 x i64> poison, <32 x i32> +; RV32-NEXT: Cost Model: Found an estimated cost of 278 for instruction: %uzpv16i64 = shufflevector <16 x i64> poison, <16 x i64> poison, <32 x i32> ; RV32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void ; ; RV64-LABEL: 'shuffle2' @@ -606,86 +555,47 @@ define void @shuffle2() vscale_range(2,2) { ; RV64-NEXT: Cost Model: Found an estimated cost of 74 for instruction: %uzpv8i64 = shufflevector <8 x i64> poison, <8 x i64> poison, <16 x i32> ; RV64-NEXT: Cost Model: Found an estimated cost of 151 for instruction: %uzp1v16i64 = shufflevector <16 x i64> poison, <16 x i64> poison, <16 x i32> ; RV64-NEXT: Cost Model: Found an estimated cost of 151 for instruction: %uzp2v16i64 = shufflevector <16 x i64> poison, <16 x i64> poison, <16 x i32> -; RV64-NEXT: Cost Model: Found an estimated cost of 96 for instruction: %uzpv16i64 = shufflevector <16 x i64> poison, <16 x i64> poison, <32 x i32> +; RV64-NEXT: Cost Model: Found an estimated cost of 302 for instruction: %uzpv16i64 = shufflevector <16 x i64> poison, <16 x i64> poison, <32 x i32> ; RV64-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void ; -; RV32-SIZE-LABEL: 'shuffle2' -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp1v4i8 = shufflevector <4 x i8> poison, <4 x i8> poison, <4 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp2v4i8 = shufflevector <4 x i8> poison, <4 x i8> poison, <4 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %uzpv4i8 = shufflevector <4 x i8> poison, <4 x i8> poison, <8 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp1v8i8 = shufflevector <8 x i8> poison, <8 x i8> poison, <8 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp2v8i8 = shufflevector <8 x i8> poison, <8 x i8> poison, <8 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %uzpv8i8 = shufflevector <8 x i8> poison, <8 x i8> poison, <16 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp1v16i8 = shufflevector <16 x i8> poison, <16 x i8> poison, <16 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp2v16i8 = shufflevector <16 x i8> poison, <16 x i8> poison, <16 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %uzpv16i8 = shufflevector <16 x i8> poison, <16 x i8> poison, <32 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp1v4i16 = shufflevector <4 x i16> poison, <4 x i16> poison, <4 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp2v4i16 = shufflevector <4 x i16> poison, <4 x i16> poison, <4 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %uzpv4i16 = shufflevector <4 x i16> poison, <4 x i16> poison, <8 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp1v8i16 = shufflevector <8 x i16> poison, <8 x i16> poison, <8 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp2v8i16 = shufflevector <8 x i16> poison, <8 x i16> poison, <8 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %uzpv8i16 = shufflevector <8 x i16> poison, <8 x i16> poison, <16 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp1v16i16 = shufflevector <16 x i16> poison, <16 x i16> poison, <16 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp2v16i16 = shufflevector <16 x i16> poison, <16 x i16> poison, <16 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %uzpv16i16 = shufflevector <16 x i16> poison, <16 x i16> poison, <32 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp1v4i32 = shufflevector <4 x i32> poison, <4 x i32> poison, <4 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp2v4i32 = shufflevector <4 x i32> poison, <4 x i32> poison, <4 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %uzpv4i32 = shufflevector <4 x i32> poison, <4 x i32> poison, <8 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp1v8i32 = shufflevector <8 x i32> poison, <8 x i32> poison, <8 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp2v8i32 = shufflevector <8 x i32> poison, <8 x i32> poison, <8 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %uzpv8i32 = shufflevector <8 x i32> poison, <8 x i32> poison, <16 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp1v16i32 = shufflevector <16 x i32> poison, <16 x i32> poison, <16 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp2v16i32 = shufflevector <16 x i32> poison, <16 x i32> poison, <16 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %uzpv16i32 = shufflevector <16 x i32> poison, <16 x i32> poison, <32 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp1v4i64 = shufflevector <4 x i64> poison, <4 x i64> poison, <4 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp2v4i64 = shufflevector <4 x i64> poison, <4 x i64> poison, <4 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %uzpv4i64 = shufflevector <4 x i64> poison, <4 x i64> poison, <8 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp1v8i64 = shufflevector <8 x i64> poison, <8 x i64> poison, <8 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp2v8i64 = shufflevector <8 x i64> poison, <8 x i64> poison, <8 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %uzpv8i64 = shufflevector <8 x i64> poison, <8 x i64> poison, <16 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp1v16i64 = shufflevector <16 x i64> poison, <16 x i64> poison, <16 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp2v16i64 = shufflevector <16 x i64> poison, <16 x i64> poison, <16 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 256 for instruction: %uzpv16i64 = shufflevector <16 x i64> poison, <16 x i64> poison, <32 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void -; -; RV64-SIZE-LABEL: 'shuffle2' -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp1v4i8 = shufflevector <4 x i8> poison, <4 x i8> poison, <4 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp2v4i8 = shufflevector <4 x i8> poison, <4 x i8> poison, <4 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %uzpv4i8 = shufflevector <4 x i8> poison, <4 x i8> poison, <8 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp1v8i8 = shufflevector <8 x i8> poison, <8 x i8> poison, <8 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp2v8i8 = shufflevector <8 x i8> poison, <8 x i8> poison, <8 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %uzpv8i8 = shufflevector <8 x i8> poison, <8 x i8> poison, <16 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp1v16i8 = shufflevector <16 x i8> poison, <16 x i8> poison, <16 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp2v16i8 = shufflevector <16 x i8> poison, <16 x i8> poison, <16 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %uzpv16i8 = shufflevector <16 x i8> poison, <16 x i8> poison, <32 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp1v4i16 = shufflevector <4 x i16> poison, <4 x i16> poison, <4 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp2v4i16 = shufflevector <4 x i16> poison, <4 x i16> poison, <4 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %uzpv4i16 = shufflevector <4 x i16> poison, <4 x i16> poison, <8 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp1v8i16 = shufflevector <8 x i16> poison, <8 x i16> poison, <8 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp2v8i16 = shufflevector <8 x i16> poison, <8 x i16> poison, <8 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %uzpv8i16 = shufflevector <8 x i16> poison, <8 x i16> poison, <16 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp1v16i16 = shufflevector <16 x i16> poison, <16 x i16> poison, <16 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp2v16i16 = shufflevector <16 x i16> poison, <16 x i16> poison, <16 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %uzpv16i16 = shufflevector <16 x i16> poison, <16 x i16> poison, <32 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp1v4i32 = shufflevector <4 x i32> poison, <4 x i32> poison, <4 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp2v4i32 = shufflevector <4 x i32> poison, <4 x i32> poison, <4 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %uzpv4i32 = shufflevector <4 x i32> poison, <4 x i32> poison, <8 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp1v8i32 = shufflevector <8 x i32> poison, <8 x i32> poison, <8 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp2v8i32 = shufflevector <8 x i32> poison, <8 x i32> poison, <8 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %uzpv8i32 = shufflevector <8 x i32> poison, <8 x i32> poison, <16 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp1v16i32 = shufflevector <16 x i32> poison, <16 x i32> poison, <16 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp2v16i32 = shufflevector <16 x i32> poison, <16 x i32> poison, <16 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %uzpv16i32 = shufflevector <16 x i32> poison, <16 x i32> poison, <32 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp1v4i64 = shufflevector <4 x i64> poison, <4 x i64> poison, <4 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp2v4i64 = shufflevector <4 x i64> poison, <4 x i64> poison, <4 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %uzpv4i64 = shufflevector <4 x i64> poison, <4 x i64> poison, <8 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp1v8i64 = shufflevector <8 x i64> poison, <8 x i64> poison, <8 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp2v8i64 = shufflevector <8 x i64> poison, <8 x i64> poison, <8 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %uzpv8i64 = shufflevector <8 x i64> poison, <8 x i64> poison, <16 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp1v16i64 = shufflevector <16 x i64> poison, <16 x i64> poison, <16 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp2v16i64 = shufflevector <16 x i64> poison, <16 x i64> poison, <16 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 96 for instruction: %uzpv16i64 = shufflevector <16 x i64> poison, <16 x i64> poison, <32 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void +; CHECK-SIZE-LABEL: 'shuffle2' +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp1v4i8 = shufflevector <4 x i8> poison, <4 x i8> poison, <4 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp2v4i8 = shufflevector <4 x i8> poison, <4 x i8> poison, <4 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %uzpv4i8 = shufflevector <4 x i8> poison, <4 x i8> poison, <8 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp1v8i8 = shufflevector <8 x i8> poison, <8 x i8> poison, <8 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp2v8i8 = shufflevector <8 x i8> poison, <8 x i8> poison, <8 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %uzpv8i8 = shufflevector <8 x i8> poison, <8 x i8> poison, <16 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp1v16i8 = shufflevector <16 x i8> poison, <16 x i8> poison, <16 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp2v16i8 = shufflevector <16 x i8> poison, <16 x i8> poison, <16 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %uzpv16i8 = shufflevector <16 x i8> poison, <16 x i8> poison, <32 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp1v4i16 = shufflevector <4 x i16> poison, <4 x i16> poison, <4 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp2v4i16 = shufflevector <4 x i16> poison, <4 x i16> poison, <4 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %uzpv4i16 = shufflevector <4 x i16> poison, <4 x i16> poison, <8 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp1v8i16 = shufflevector <8 x i16> poison, <8 x i16> poison, <8 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp2v8i16 = shufflevector <8 x i16> poison, <8 x i16> poison, <8 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %uzpv8i16 = shufflevector <8 x i16> poison, <8 x i16> poison, <16 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp1v16i16 = shufflevector <16 x i16> poison, <16 x i16> poison, <16 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp2v16i16 = shufflevector <16 x i16> poison, <16 x i16> poison, <16 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %uzpv16i16 = shufflevector <16 x i16> poison, <16 x i16> poison, <32 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp1v4i32 = shufflevector <4 x i32> poison, <4 x i32> poison, <4 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp2v4i32 = shufflevector <4 x i32> poison, <4 x i32> poison, <4 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %uzpv4i32 = shufflevector <4 x i32> poison, <4 x i32> poison, <8 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp1v8i32 = shufflevector <8 x i32> poison, <8 x i32> poison, <8 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp2v8i32 = shufflevector <8 x i32> poison, <8 x i32> poison, <8 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %uzpv8i32 = shufflevector <8 x i32> poison, <8 x i32> poison, <16 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp1v16i32 = shufflevector <16 x i32> poison, <16 x i32> poison, <16 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp2v16i32 = shufflevector <16 x i32> poison, <16 x i32> poison, <16 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %uzpv16i32 = shufflevector <16 x i32> poison, <16 x i32> poison, <32 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp1v4i64 = shufflevector <4 x i64> poison, <4 x i64> poison, <4 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp2v4i64 = shufflevector <4 x i64> poison, <4 x i64> poison, <4 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %uzpv4i64 = shufflevector <4 x i64> poison, <4 x i64> poison, <8 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp1v8i64 = shufflevector <8 x i64> poison, <8 x i64> poison, <8 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp2v8i64 = shufflevector <8 x i64> poison, <8 x i64> poison, <8 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %uzpv8i64 = shufflevector <8 x i64> poison, <8 x i64> poison, <16 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp1v16i64 = shufflevector <16 x i64> poison, <16 x i64> poison, <16 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %uzp2v16i64 = shufflevector <16 x i64> poison, <16 x i64> poison, <16 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %uzpv16i64 = shufflevector <16 x i64> poison, <16 x i64> poison, <32 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void ; %uzp1v4i8 = shufflevector <4 x i8> poison, <4 x i8> poison, <4 x i32> %uzp2v4i8 = shufflevector <4 x i8> poison, <4 x i8> poison, <4 x i32> @@ -810,11 +720,11 @@ define void @shuffle4(ptr %p) vscale_range(2,2) { ; RV32-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %v8i32 = shufflevector <4 x i32> poison, <4 x i32> poison, <6 x i32> ; RV32-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %v16i32 = shufflevector <8 x i32> poison, <8 x i32> poison, <12 x i32> ; RV32-NEXT: Cost Model: Found an estimated cost of 74 for instruction: %v32i32 = shufflevector <16 x i32> poison, <16 x i32> poison, <24 x i32> -; RV32-NEXT: Cost Model: Found an estimated cost of 168 for instruction: %v64i32 = shufflevector <32 x i32> poison, <32 x i32> poison, <48 x i32> +; RV32-NEXT: Cost Model: Found an estimated cost of 302 for instruction: %v64i32 = shufflevector <32 x i32> poison, <32 x i32> poison, <48 x i32> ; RV32-NEXT: Cost Model: Found an estimated cost of 19 for instruction: %v8i64 = shufflevector <4 x i64> poison, <4 x i64> poison, <6 x i32> ; RV32-NEXT: Cost Model: Found an estimated cost of 68 for instruction: %v16i64 = shufflevector <8 x i64> poison, <8 x i64> poison, <12 x i32> -; RV32-NEXT: Cost Model: Found an estimated cost of 192 for instruction: %v32i64 = shufflevector <16 x i64> poison, <16 x i64> poison, <24 x i32> -; RV32-NEXT: Cost Model: Found an estimated cost of 384 for instruction: %v64i64 = shufflevector <32 x i64> poison, <32 x i64> poison, <48 x i32> +; RV32-NEXT: Cost Model: Found an estimated cost of 175 for instruction: %v32i64 = shufflevector <16 x i64> poison, <16 x i64> poison, <24 x i32> +; RV32-NEXT: Cost Model: Found an estimated cost of 626 for instruction: %v64i64 = shufflevector <32 x i64> poison, <32 x i64> poison, <48 x i32> ; RV32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void ; ; RV64-LABEL: 'shuffle4' @@ -829,50 +739,31 @@ define void @shuffle4(ptr %p) vscale_range(2,2) { ; RV64-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %v8i32 = shufflevector <4 x i32> poison, <4 x i32> poison, <6 x i32> ; RV64-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %v16i32 = shufflevector <8 x i32> poison, <8 x i32> poison, <12 x i32> ; RV64-NEXT: Cost Model: Found an estimated cost of 74 for instruction: %v32i32 = shufflevector <16 x i32> poison, <16 x i32> poison, <24 x i32> -; RV64-NEXT: Cost Model: Found an estimated cost of 168 for instruction: %v64i32 = shufflevector <32 x i32> poison, <32 x i32> poison, <48 x i32> +; RV64-NEXT: Cost Model: Found an estimated cost of 302 for instruction: %v64i32 = shufflevector <32 x i32> poison, <32 x i32> poison, <48 x i32> ; RV64-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %v8i64 = shufflevector <4 x i64> poison, <4 x i64> poison, <6 x i32> ; RV64-NEXT: Cost Model: Found an estimated cost of 74 for instruction: %v16i64 = shufflevector <8 x i64> poison, <8 x i64> poison, <12 x i32> -; RV64-NEXT: Cost Model: Found an estimated cost of 72 for instruction: %v32i64 = shufflevector <16 x i64> poison, <16 x i64> poison, <24 x i32> -; RV64-NEXT: Cost Model: Found an estimated cost of 144 for instruction: %v64i64 = shufflevector <32 x i64> poison, <32 x i64> poison, <48 x i32> +; RV64-NEXT: Cost Model: Found an estimated cost of 187 for instruction: %v32i64 = shufflevector <16 x i64> poison, <16 x i64> poison, <24 x i32> +; RV64-NEXT: Cost Model: Found an estimated cost of 674 for instruction: %v64i64 = shufflevector <32 x i64> poison, <32 x i64> poison, <48 x i32> ; RV64-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void ; -; RV32-SIZE-LABEL: 'shuffle4' -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v8i8 = shufflevector <4 x i8> poison, <4 x i8> poison, <6 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v16i8 = shufflevector <8 x i8> poison, <8 x i8> poison, <12 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v32i8 = shufflevector <16 x i8> poison, <16 x i8> poison, <24 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v64i8 = shufflevector <32 x i8> poison, <32 x i8> poison, <48 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v8i16 = shufflevector <4 x i16> poison, <4 x i16> poison, <6 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v16i16 = shufflevector <8 x i16> poison, <8 x i16> poison, <12 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v32i16 = shufflevector <16 x i16> poison, <16 x i16> poison, <24 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v64i16 = shufflevector <32 x i16> poison, <32 x i16> poison, <48 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v8i32 = shufflevector <4 x i32> poison, <4 x i32> poison, <6 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v16i32 = shufflevector <8 x i32> poison, <8 x i32> poison, <12 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v32i32 = shufflevector <16 x i32> poison, <16 x i32> poison, <24 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 168 for instruction: %v64i32 = shufflevector <32 x i32> poison, <32 x i32> poison, <48 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v8i64 = shufflevector <4 x i64> poison, <4 x i64> poison, <6 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v16i64 = shufflevector <8 x i64> poison, <8 x i64> poison, <12 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 192 for instruction: %v32i64 = shufflevector <16 x i64> poison, <16 x i64> poison, <24 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 384 for instruction: %v64i64 = shufflevector <32 x i64> poison, <32 x i64> poison, <48 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void -; -; RV64-SIZE-LABEL: 'shuffle4' -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v8i8 = shufflevector <4 x i8> poison, <4 x i8> poison, <6 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v16i8 = shufflevector <8 x i8> poison, <8 x i8> poison, <12 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v32i8 = shufflevector <16 x i8> poison, <16 x i8> poison, <24 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v64i8 = shufflevector <32 x i8> poison, <32 x i8> poison, <48 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v8i16 = shufflevector <4 x i16> poison, <4 x i16> poison, <6 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v16i16 = shufflevector <8 x i16> poison, <8 x i16> poison, <12 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v32i16 = shufflevector <16 x i16> poison, <16 x i16> poison, <24 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v64i16 = shufflevector <32 x i16> poison, <32 x i16> poison, <48 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v8i32 = shufflevector <4 x i32> poison, <4 x i32> poison, <6 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v16i32 = shufflevector <8 x i32> poison, <8 x i32> poison, <12 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v32i32 = shufflevector <16 x i32> poison, <16 x i32> poison, <24 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 168 for instruction: %v64i32 = shufflevector <32 x i32> poison, <32 x i32> poison, <48 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v8i64 = shufflevector <4 x i64> poison, <4 x i64> poison, <6 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v16i64 = shufflevector <8 x i64> poison, <8 x i64> poison, <12 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 72 for instruction: %v32i64 = shufflevector <16 x i64> poison, <16 x i64> poison, <24 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 144 for instruction: %v64i64 = shufflevector <32 x i64> poison, <32 x i64> poison, <48 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void +; CHECK-SIZE-LABEL: 'shuffle4' +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v8i8 = shufflevector <4 x i8> poison, <4 x i8> poison, <6 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v16i8 = shufflevector <8 x i8> poison, <8 x i8> poison, <12 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v32i8 = shufflevector <16 x i8> poison, <16 x i8> poison, <24 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v64i8 = shufflevector <32 x i8> poison, <32 x i8> poison, <48 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v8i16 = shufflevector <4 x i16> poison, <4 x i16> poison, <6 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v16i16 = shufflevector <8 x i16> poison, <8 x i16> poison, <12 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v32i16 = shufflevector <16 x i16> poison, <16 x i16> poison, <24 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v64i16 = shufflevector <32 x i16> poison, <32 x i16> poison, <48 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v8i32 = shufflevector <4 x i32> poison, <4 x i32> poison, <6 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v16i32 = shufflevector <8 x i32> poison, <8 x i32> poison, <12 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v32i32 = shufflevector <16 x i32> poison, <16 x i32> poison, <24 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %v64i32 = shufflevector <32 x i32> poison, <32 x i32> poison, <48 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v8i64 = shufflevector <4 x i64> poison, <4 x i64> poison, <6 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v16i64 = shufflevector <8 x i64> poison, <8 x i64> poison, <12 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 47 for instruction: %v32i64 = shufflevector <16 x i64> poison, <16 x i64> poison, <24 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 114 for instruction: %v64i64 = shufflevector <32 x i64> poison, <32 x i64> poison, <48 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void ; %v8i8 = shufflevector <4 x i8> poison, <4 x i8> poison, <6 x i32> %v16i8 = shufflevector <8 x i8> poison, <8 x i8> poison, <12 x i32> @@ -911,11 +802,11 @@ define void @shuffle5(ptr %p) vscale_range(2,2) { ; RV32-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %v8i32 = shufflevector <8 x i32> poison, <8 x i32> poison, <8 x i32> ; RV32-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %v16i32 = shufflevector <16 x i32> poison, <16 x i32> poison, <16 x i32> ; RV32-NEXT: Cost Model: Found an estimated cost of 74 for instruction: %v32i32 = shufflevector <32 x i32> poison, <32 x i32> poison, <32 x i32> -; RV32-NEXT: Cost Model: Found an estimated cost of 224 for instruction: %v64i32 = shufflevector <64 x i32> poison, <64 x i32> poison, <64 x i32> +; RV32-NEXT: Cost Model: Found an estimated cost of 302 for instruction: %v64i32 = shufflevector <64 x i32> poison, <64 x i32> poison, <64 x i32> ; RV32-NEXT: Cost Model: Found an estimated cost of 19 for instruction: %v8i64 = shufflevector <8 x i64> poison, <8 x i64> poison, <8 x i32> ; RV32-NEXT: Cost Model: Found an estimated cost of 68 for instruction: %v16i64 = shufflevector <16 x i64> poison, <16 x i64> poison, <16 x i32> -; RV32-NEXT: Cost Model: Found an estimated cost of 256 for instruction: %v32i64 = shufflevector <32 x i64> poison, <32 x i64> poison, <32 x i32> -; RV32-NEXT: Cost Model: Found an estimated cost of 512 for instruction: %v64i64 = shufflevector <64 x i64> poison, <64 x i64> poison, <64 x i32> +; RV32-NEXT: Cost Model: Found an estimated cost of 278 for instruction: %v32i64 = shufflevector <32 x i64> poison, <32 x i64> poison, <32 x i32> +; RV32-NEXT: Cost Model: Found an estimated cost of 352 for instruction: %v64i64 = shufflevector <64 x i64> poison, <64 x i64> poison, <64 x i32> ; RV32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void ; ; RV64-LABEL: 'shuffle5' @@ -930,50 +821,31 @@ define void @shuffle5(ptr %p) vscale_range(2,2) { ; RV64-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %v8i32 = shufflevector <8 x i32> poison, <8 x i32> poison, <8 x i32> ; RV64-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %v16i32 = shufflevector <16 x i32> poison, <16 x i32> poison, <16 x i32> ; RV64-NEXT: Cost Model: Found an estimated cost of 74 for instruction: %v32i32 = shufflevector <32 x i32> poison, <32 x i32> poison, <32 x i32> -; RV64-NEXT: Cost Model: Found an estimated cost of 224 for instruction: %v64i32 = shufflevector <64 x i32> poison, <64 x i32> poison, <64 x i32> +; RV64-NEXT: Cost Model: Found an estimated cost of 302 for instruction: %v64i32 = shufflevector <64 x i32> poison, <64 x i32> poison, <64 x i32> ; RV64-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %v8i64 = shufflevector <8 x i64> poison, <8 x i64> poison, <8 x i32> ; RV64-NEXT: Cost Model: Found an estimated cost of 74 for instruction: %v16i64 = shufflevector <16 x i64> poison, <16 x i64> poison, <16 x i32> -; RV64-NEXT: Cost Model: Found an estimated cost of 96 for instruction: %v32i64 = shufflevector <32 x i64> poison, <32 x i64> poison, <32 x i32> -; RV64-NEXT: Cost Model: Found an estimated cost of 192 for instruction: %v64i64 = shufflevector <64 x i64> poison, <64 x i64> poison, <64 x i32> +; RV64-NEXT: Cost Model: Found an estimated cost of 302 for instruction: %v32i64 = shufflevector <32 x i64> poison, <32 x i64> poison, <32 x i32> +; RV64-NEXT: Cost Model: Found an estimated cost of 352 for instruction: %v64i64 = shufflevector <64 x i64> poison, <64 x i64> poison, <64 x i32> ; RV64-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void ; -; RV32-SIZE-LABEL: 'shuffle5' -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v8i8 = shufflevector <8 x i8> poison, <8 x i8> poison, <8 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v16i8 = shufflevector <16 x i8> poison, <16 x i8> poison, <16 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v32i8 = shufflevector <32 x i8> poison, <32 x i8> poison, <32 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v64i8 = shufflevector <64 x i8> poison, <64 x i8> poison, <64 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v8i16 = shufflevector <8 x i16> poison, <8 x i16> poison, <8 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v16i16 = shufflevector <16 x i16> poison, <16 x i16> poison, <16 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v32i16 = shufflevector <32 x i16> poison, <32 x i16> poison, <32 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v64i16 = shufflevector <64 x i16> poison, <64 x i16> poison, <64 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v8i32 = shufflevector <8 x i32> poison, <8 x i32> poison, <8 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v16i32 = shufflevector <16 x i32> poison, <16 x i32> poison, <16 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v32i32 = shufflevector <32 x i32> poison, <32 x i32> poison, <32 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 224 for instruction: %v64i32 = shufflevector <64 x i32> poison, <64 x i32> poison, <64 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v8i64 = shufflevector <8 x i64> poison, <8 x i64> poison, <8 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v16i64 = shufflevector <16 x i64> poison, <16 x i64> poison, <16 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 256 for instruction: %v32i64 = shufflevector <32 x i64> poison, <32 x i64> poison, <32 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 512 for instruction: %v64i64 = shufflevector <64 x i64> poison, <64 x i64> poison, <64 x i32> -; RV32-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void -; -; RV64-SIZE-LABEL: 'shuffle5' -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v8i8 = shufflevector <8 x i8> poison, <8 x i8> poison, <8 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v16i8 = shufflevector <16 x i8> poison, <16 x i8> poison, <16 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v32i8 = shufflevector <32 x i8> poison, <32 x i8> poison, <32 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v64i8 = shufflevector <64 x i8> poison, <64 x i8> poison, <64 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v8i16 = shufflevector <8 x i16> poison, <8 x i16> poison, <8 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v16i16 = shufflevector <16 x i16> poison, <16 x i16> poison, <16 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v32i16 = shufflevector <32 x i16> poison, <32 x i16> poison, <32 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v64i16 = shufflevector <64 x i16> poison, <64 x i16> poison, <64 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v8i32 = shufflevector <8 x i32> poison, <8 x i32> poison, <8 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v16i32 = shufflevector <16 x i32> poison, <16 x i32> poison, <16 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v32i32 = shufflevector <32 x i32> poison, <32 x i32> poison, <32 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 224 for instruction: %v64i32 = shufflevector <64 x i32> poison, <64 x i32> poison, <64 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v8i64 = shufflevector <8 x i64> poison, <8 x i64> poison, <8 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v16i64 = shufflevector <16 x i64> poison, <16 x i64> poison, <16 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 96 for instruction: %v32i64 = shufflevector <32 x i64> poison, <32 x i64> poison, <32 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 192 for instruction: %v64i64 = shufflevector <64 x i64> poison, <64 x i64> poison, <64 x i32> -; RV64-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void +; CHECK-SIZE-LABEL: 'shuffle5' +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v8i8 = shufflevector <8 x i8> poison, <8 x i8> poison, <8 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v16i8 = shufflevector <16 x i8> poison, <16 x i8> poison, <16 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v32i8 = shufflevector <32 x i8> poison, <32 x i8> poison, <32 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v64i8 = shufflevector <64 x i8> poison, <64 x i8> poison, <64 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v8i16 = shufflevector <8 x i16> poison, <8 x i16> poison, <8 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v16i16 = shufflevector <16 x i16> poison, <16 x i16> poison, <16 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v32i16 = shufflevector <32 x i16> poison, <32 x i16> poison, <32 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v64i16 = shufflevector <64 x i16> poison, <64 x i16> poison, <64 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v8i32 = shufflevector <8 x i32> poison, <8 x i32> poison, <8 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v16i32 = shufflevector <16 x i32> poison, <16 x i32> poison, <16 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v32i32 = shufflevector <32 x i32> poison, <32 x i32> poison, <32 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %v64i32 = shufflevector <64 x i32> poison, <64 x i32> poison, <64 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v8i64 = shufflevector <8 x i64> poison, <8 x i64> poison, <8 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v16i64 = shufflevector <16 x i64> poison, <16 x i64> poison, <16 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %v32i64 = shufflevector <32 x i64> poison, <32 x i64> poison, <32 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 352 for instruction: %v64i64 = shufflevector <64 x i64> poison, <64 x i64> poison, <64 x i32> +; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void ; %v8i8 = shufflevector <8 x i8> poison, <8 x i8> poison, <8 x i32> %v16i8 = shufflevector <16 x i8> poison, <16 x i8> poison, <16 x i32> @@ -997,3 +869,6 @@ define void @shuffle5(ptr %p) vscale_range(2,2) { ret void } +;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: +; RV32-SIZE: {{.*}} +; RV64-SIZE: {{.*}} diff --git a/llvm/test/Analysis/CostModel/RISCV/shuffle-permute.ll b/llvm/test/Analysis/CostModel/RISCV/shuffle-permute.ll index 973032853c20f..867d5aac3b9c9 100644 --- a/llvm/test/Analysis/CostModel/RISCV/shuffle-permute.ll +++ b/llvm/test/Analysis/CostModel/RISCV/shuffle-permute.ll @@ -226,24 +226,24 @@ define void @general_permute_two_source() { define void @legalization_examples() { ; CHECK-LABEL: 'legalization_examples' -; CHECK-NEXT: Cost Model: Found an estimated cost of 284 for instruction: %1 = shufflevector <32 x i64> undef, <32 x i64> undef, <16 x i32> -; CHECK-NEXT: Cost Model: Found an estimated cost of 284 for instruction: %2 = shufflevector <16 x i64> undef, <16 x i64> undef, <32 x i32> -; CHECK-NEXT: Cost Model: Found an estimated cost of 284 for instruction: %3 = shufflevector <32 x i64> undef, <32 x i64> undef, <32 x i32> -; CHECK-NEXT: Cost Model: Found an estimated cost of 284 for instruction: %4 = shufflevector <32 x i64> undef, <32 x i64> undef, <32 x i32> +; CHECK-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %1 = shufflevector <32 x i64> undef, <32 x i64> undef, <16 x i32> +; CHECK-NEXT: Cost Model: Found an estimated cost of 19 for instruction: %2 = shufflevector <16 x i64> undef, <16 x i64> undef, <32 x i32> +; CHECK-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %3 = shufflevector <32 x i64> undef, <32 x i64> undef, <32 x i32> +; CHECK-NEXT: Cost Model: Found an estimated cost of 294 for instruction: %4 = shufflevector <32 x i64> undef, <32 x i64> undef, <32 x i32> ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void ; ; SIZE-LABEL: 'legalization_examples' -; SIZE-NEXT: Cost Model: Found an estimated cost of 284 for instruction: %1 = shufflevector <32 x i64> undef, <32 x i64> undef, <16 x i32> -; SIZE-NEXT: Cost Model: Found an estimated cost of 284 for instruction: %2 = shufflevector <16 x i64> undef, <16 x i64> undef, <32 x i32> -; SIZE-NEXT: Cost Model: Found an estimated cost of 284 for instruction: %3 = shufflevector <32 x i64> undef, <32 x i64> undef, <32 x i32> -; SIZE-NEXT: Cost Model: Found an estimated cost of 284 for instruction: %4 = shufflevector <32 x i64> undef, <32 x i64> undef, <32 x i32> +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = shufflevector <32 x i64> undef, <32 x i64> undef, <16 x i32> +; SIZE-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %2 = shufflevector <16 x i64> undef, <16 x i64> undef, <32 x i32> +; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %3 = shufflevector <32 x i64> undef, <32 x i64> undef, <32 x i32> +; SIZE-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %4 = shufflevector <32 x i64> undef, <32 x i64> undef, <32 x i32> ; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void ; ; LOG-VRG-LABEL: 'legalization_examples' -; LOG-VRG-NEXT: Cost Model: Found an estimated cost of 284 for instruction: %1 = shufflevector <32 x i64> undef, <32 x i64> undef, <16 x i32> -; LOG-VRG-NEXT: Cost Model: Found an estimated cost of 284 for instruction: %2 = shufflevector <16 x i64> undef, <16 x i64> undef, <32 x i32> -; LOG-VRG-NEXT: Cost Model: Found an estimated cost of 284 for instruction: %3 = shufflevector <32 x i64> undef, <32 x i64> undef, <32 x i32> -; LOG-VRG-NEXT: Cost Model: Found an estimated cost of 284 for instruction: %4 = shufflevector <32 x i64> undef, <32 x i64> undef, <32 x i32> +; LOG-VRG-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %1 = shufflevector <32 x i64> undef, <32 x i64> undef, <16 x i32> +; LOG-VRG-NEXT: Cost Model: Found an estimated cost of 19 for instruction: %2 = shufflevector <16 x i64> undef, <16 x i64> undef, <32 x i32> +; LOG-VRG-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %3 = shufflevector <32 x i64> undef, <32 x i64> undef, <32 x i32> +; LOG-VRG-NEXT: Cost Model: Found an estimated cost of 134 for instruction: %4 = shufflevector <32 x i64> undef, <32 x i64> undef, <32 x i32> ; LOG-VRG-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void ; shufflevector <32 x i64> undef, <32 x i64> undef, <16 x i32> diff --git a/llvm/test/Transforms/SLPVectorizer/RISCV/reductions.ll b/llvm/test/Transforms/SLPVectorizer/RISCV/reductions.ll index 5d9975b25c381..db09843a6ef72 100644 --- a/llvm/test/Transforms/SLPVectorizer/RISCV/reductions.ll +++ b/llvm/test/Transforms/SLPVectorizer/RISCV/reductions.ll @@ -4,13 +4,13 @@ ; RUN: | FileCheck %s --check-prefixes=CHECK,ZVFHMIN ; RUN: opt < %s -passes=slp-vectorizer -mtriple=riscv64 \ ; RUN: -mattr=+v,+zvfh,+zvfbfmin -riscv-v-slp-max-vf=0 -S \ -; RUN: | FileCheck %s --check-prefixes=CHECK,ZVFH,ZVL128 +; RUN: | FileCheck %s --check-prefixes=CHECK,ZVFH ; RUN: opt < %s -passes=slp-vectorizer -mtriple=riscv64 \ ; RUN: -mattr=+v,+zvl256b,+zvfh,+zvfbfmin -riscv-v-slp-max-vf=0 -S \ -; RUN: | FileCheck %s --check-prefixes=CHECK,ZVFH,ZVL256 +; RUN: | FileCheck %s --check-prefixes=CHECK,ZVFH ; RUN: opt < %s -passes=slp-vectorizer -mtriple=riscv64 \ ; RUN: -mattr=+v,+zvl512b,+zvfh,+zvfbfmin -riscv-v-slp-max-vf=0 -S \ -; RUN: | FileCheck %s --check-prefixes=CHECK,ZVFH,ZVL512 +; RUN: | FileCheck %s --check-prefixes=CHECK,ZVFH target datalayout = "e-m:e-p:64:64-i64:64-i128:128-n64-S128" target triple = "riscv64" @@ -335,57 +335,17 @@ entry: } define void @reduce_or_2() { -; ZVFHMIN-LABEL: @reduce_or_2( -; ZVFHMIN-NEXT: [[TMP1:%.*]] = shl i64 0, 0 -; ZVFHMIN-NEXT: [[TMP2:%.*]] = insertelement <16 x i64> , i64 [[TMP1]], i32 15 -; ZVFHMIN-NEXT: [[TMP3:%.*]] = icmp ult <16 x i64> [[TMP2]], zeroinitializer -; ZVFHMIN-NEXT: [[TMP4:%.*]] = insertelement <16 x i64> , i64 [[TMP1]], i32 6 -; ZVFHMIN-NEXT: [[TMP5:%.*]] = icmp ult <16 x i64> [[TMP4]], zeroinitializer -; ZVFHMIN-NEXT: [[RDX_OP:%.*]] = or <16 x i1> [[TMP3]], [[TMP5]] -; ZVFHMIN-NEXT: [[TMP6:%.*]] = call i1 @llvm.vector.reduce.or.v16i1(<16 x i1> [[RDX_OP]]) -; ZVFHMIN-NEXT: br i1 [[TMP6]], label [[TMP8:%.*]], label [[TMP7:%.*]] -; ZVFHMIN: 7: -; ZVFHMIN-NEXT: ret void -; ZVFHMIN: 8: -; ZVFHMIN-NEXT: ret void -; -; ZVL128-LABEL: @reduce_or_2( -; ZVL128-NEXT: [[TMP1:%.*]] = shl i64 0, 0 -; ZVL128-NEXT: [[TMP2:%.*]] = insertelement <16 x i64> , i64 [[TMP1]], i32 15 -; ZVL128-NEXT: [[TMP3:%.*]] = icmp ult <16 x i64> [[TMP2]], zeroinitializer -; ZVL128-NEXT: [[TMP4:%.*]] = insertelement <16 x i64> , i64 [[TMP1]], i32 6 -; ZVL128-NEXT: [[TMP5:%.*]] = icmp ult <16 x i64> [[TMP4]], zeroinitializer -; ZVL128-NEXT: [[RDX_OP:%.*]] = or <16 x i1> [[TMP3]], [[TMP5]] -; ZVL128-NEXT: [[TMP6:%.*]] = call i1 @llvm.vector.reduce.or.v16i1(<16 x i1> [[RDX_OP]]) -; ZVL128-NEXT: br i1 [[TMP6]], label [[TMP8:%.*]], label [[TMP7:%.*]] -; ZVL128: 7: -; ZVL128-NEXT: ret void -; ZVL128: 8: -; ZVL128-NEXT: ret void -; -; ZVL256-LABEL: @reduce_or_2( -; ZVL256-NEXT: [[TMP1:%.*]] = shl i64 0, 0 -; ZVL256-NEXT: [[TMP2:%.*]] = insertelement <32 x i64> , i64 [[TMP1]], i32 15 -; ZVL256-NEXT: [[TMP3:%.*]] = shufflevector <32 x i64> [[TMP2]], <32 x i64> poison, <32 x i32> -; ZVL256-NEXT: [[TMP4:%.*]] = icmp ult <32 x i64> [[TMP3]], zeroinitializer -; ZVL256-NEXT: [[TMP5:%.*]] = call i1 @llvm.vector.reduce.or.v32i1(<32 x i1> [[TMP4]]) -; ZVL256-NEXT: br i1 [[TMP5]], label [[TMP7:%.*]], label [[TMP6:%.*]] -; ZVL256: 6: -; ZVL256-NEXT: ret void -; ZVL256: 7: -; ZVL256-NEXT: ret void -; -; ZVL512-LABEL: @reduce_or_2( -; ZVL512-NEXT: [[TMP1:%.*]] = shl i64 0, 0 -; ZVL512-NEXT: [[TMP2:%.*]] = insertelement <32 x i64> , i64 [[TMP1]], i32 15 -; ZVL512-NEXT: [[TMP3:%.*]] = shufflevector <32 x i64> [[TMP2]], <32 x i64> poison, <32 x i32> -; ZVL512-NEXT: [[TMP4:%.*]] = icmp ult <32 x i64> [[TMP3]], zeroinitializer -; ZVL512-NEXT: [[TMP5:%.*]] = call i1 @llvm.vector.reduce.or.v32i1(<32 x i1> [[TMP4]]) -; ZVL512-NEXT: br i1 [[TMP5]], label [[TMP7:%.*]], label [[TMP6:%.*]] -; ZVL512: 6: -; ZVL512-NEXT: ret void -; ZVL512: 7: -; ZVL512-NEXT: ret void +; CHECK-LABEL: @reduce_or_2( +; CHECK-NEXT: [[TMP1:%.*]] = shl i64 0, 0 +; CHECK-NEXT: [[TMP2:%.*]] = insertelement <32 x i64> , i64 [[TMP1]], i32 15 +; CHECK-NEXT: [[TMP3:%.*]] = shufflevector <32 x i64> [[TMP2]], <32 x i64> poison, <32 x i32> +; CHECK-NEXT: [[TMP4:%.*]] = icmp ult <32 x i64> [[TMP3]], zeroinitializer +; CHECK-NEXT: [[TMP5:%.*]] = call i1 @llvm.vector.reduce.or.v32i1(<32 x i1> [[TMP4]]) +; CHECK-NEXT: br i1 [[TMP5]], label [[TMP7:%.*]], label [[TMP6:%.*]] +; CHECK: 6: +; CHECK-NEXT: ret void +; CHECK: 7: +; CHECK-NEXT: ret void ; %1 = shl i64 0, 0 %2 = icmp ult i64 0, 0