[llvm] 721b8cd - [RISCV] Model interleave2 and deinterleave2 costs with Zvzip (#225752)

via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 29 19:34:14 PDT 2026


Author: renndong
Date: 2026-09-30T10:34:08+08:00
New Revision: 721b8cdac4f6186f772257aa739cc3fe2470c2de

URL: https://github.com/llvm/llvm-project/commit/721b8cdac4f6186f772257aa739cc3fe2470c2de
DIFF: https://github.com/llvm/llvm-project/commit/721b8cdac4f6186f772257aa739cc3fe2470c2de.diff

LOG: [RISCV] Model interleave2 and deinterleave2 costs with Zvzip (#225752)

This PR extends the RISC-V TTI cost model to recognize
`llvm.vector.interleave2` and `llvm.vector.deinterleave2` when the Zvzip
extension is available.

The cost is computed based on the operand that holds the interleaved
data: the destination operand of `vzip.vv`, and the source operand of
`unzipe.v` or `unzipo.v`.

This is the first PR split out from #224991.

Assisted-By: Trae CLI (GPT-5)

Added: 
    

Modified: 
    llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
    llvm/lib/Target/RISCV/RISCVTargetTransformInfo.h
    llvm/test/Analysis/CostModel/RISCV/shuffle-interleave.ll

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp b/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
index f2cc7ef5c1f23..83464d74a2ccb 100644
--- a/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
+++ b/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
@@ -734,6 +734,32 @@ InstructionCost RISCVTTIImpl::getSlideCost(FixedVectorType *Tp,
   return FirstSlideCost + SecondSlideCost + MaskCost;
 }
 
+std::optional<MVT> RISCVTTIImpl::getZvzipVZIPCostVT(MVT InterleavedVT) const {
+  assert(InterleavedVT.isScalableVector() && "Expected a scalable vector type");
+  if (!InterleavedVT.getVectorElementCount().isKnownEven())
+    return std::nullopt;
+
+  unsigned EltBits = InterleavedVT.getScalarSizeInBits();
+  unsigned MinSize = InterleavedVT.getSizeInBits().getKnownMinValue();
+  unsigned LMULOctuple = MinSize / (RISCV::RVVBitsPerBlock / 8);
+  // Perform the 2 * SEW <= LMUL * min(ELEN, VLEN) check.
+  if (EltBits * 16 >
+      LMULOctuple * std::min(ST->getELen(), ST->getRealMinVLen()))
+    return std::nullopt;
+  return InterleavedVT;
+}
+
+std::optional<MVT> RISCVTTIImpl::getZvzipVUNZIPCostVT(MVT InterleavedVT) const {
+  assert(InterleavedVT.isScalableVector() && "Expected a scalable vector type");
+  if (!InterleavedVT.getVectorElementCount().isKnownEven())
+    return std::nullopt;
+
+  MVT DeinterleavedVT = InterleavedVT.getHalfNumVectorElementsVT();
+  if (RISCVTargetLowering::getLMUL(DeinterleavedVT) == RISCVVType::LMUL_8)
+    return std::nullopt;
+  return InterleavedVT;
+}
+
 InstructionCost RISCVTTIImpl::getShuffleCost(
     TTI::ShuffleKind Kind, VectorType *DstTy, VectorType *SrcTy,
     TTI::TargetCostKind CostKind, ArrayRef<int> Mask, int Index,
@@ -1923,6 +1949,48 @@ RISCVTTIImpl::getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA,
                                     ValLT.second, CostKind);
     return Cost;
   }
+  case Intrinsic::vector_interleave2:
+  case Intrinsic::vector_deinterleave2: {
+    if (!ST->hasStdExtZvzip())
+      break;
+
+    bool IsInterleave = ICA.getID() == Intrinsic::vector_interleave2;
+    Type *InterleavedTy = IsInterleave ? RetTy : ICA.getArgTypes().front();
+    // ISel does not select vzip.vv if either interleave2 input is undef.
+    if (IsInterleave && !ICA.isTypeBasedOnly() &&
+        any_of(ICA.getArgs(),
+               [](const Value *Arg) { return isa<UndefValue>(Arg); }))
+      break;
+    if (InterleavedTy->getScalarSizeInBits() == 1)
+      break;
+
+    if (auto *FVT = dyn_cast<FixedVectorType>(InterleavedTy)) {
+      auto *HalfFVT = FixedVectorType::getHalfElementsVectorType(FVT);
+      unsigned HalfVF = HalfFVT->getNumElements();
+      if (IsInterleave)
+        return getShuffleCost(TTI::SK_PermuteTwoSrc, FVT, HalfFVT, CostKind,
+                              createInterleaveMask(HalfVF, 2), 0, nullptr);
+      InstructionCost Cost = 0;
+      for (unsigned Start = 0; Start != 2; ++Start)
+        Cost += getShuffleCost(TTI::SK_PermuteSingleSrc, HalfFVT, FVT, CostKind,
+                               createStrideMask(Start, 2, HalfVF), 0, nullptr);
+      return Cost;
+    }
+
+    std::pair<InstructionCost, MVT> LT = getTypeLegalizationCost(InterleavedTy);
+    if (!LT.second.isScalableVector())
+      break;
+    if (IsInterleave) {
+      if (std::optional<MVT> CostVT = getZvzipVZIPCostVT(LT.second))
+        return LT.first *
+               getRISCVInstructionCost(RISCV::VZIP_VV, *CostVT, CostKind);
+    } else if (std::optional<MVT> CostVT = getZvzipVUNZIPCostVT(LT.second)) {
+      return LT.first *
+             getRISCVInstructionCost({RISCV::VUNZIPE_V, RISCV::VUNZIPO_V},
+                                     *CostVT, CostKind);
+    }
+    break;
+  }
   }
 
   if (ST->hasVInstructions() && RetTy->isVectorTy()) {

diff  --git a/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.h b/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.h
index 0b4b36109dec9..2d179479565b5 100644
--- a/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.h
+++ b/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.h
@@ -72,6 +72,14 @@ class RISCVTTIImpl final : public BasicTTIImplBase<RISCVTTIImpl> {
   InstructionCost getSlideCost(FixedVectorType *Tp, ArrayRef<int> Mask,
                                TTI::TargetCostKind CostKind) const;
 
+  /// Return the type used to cost vzip.vv, whose LMUL represents the
+  /// interleaved destination EMUL. Return std::nullopt if illegal.
+  std::optional<MVT> getZvzipVZIPCostVT(MVT InterleavedVT) const;
+
+  /// Return the type used to cost vunzipe.v/vunzipo.v, whose LMUL represents
+  /// the interleaved source EMUL. Return std::nullopt if illegal.
+  std::optional<MVT> getZvzipVUNZIPCostVT(MVT InterleavedVT) const;
+
 public:
   explicit RISCVTTIImpl(const RISCVTargetMachine *TM, const Function &F)
       : BaseT(TM, F.getDataLayout()), ST(TM->getSubtargetImpl(F)),

diff  --git a/llvm/test/Analysis/CostModel/RISCV/shuffle-interleave.ll b/llvm/test/Analysis/CostModel/RISCV/shuffle-interleave.ll
index 27c33dca5048a..af9b7ee4f6e3f 100644
--- a/llvm/test/Analysis/CostModel/RISCV/shuffle-interleave.ll
+++ b/llvm/test/Analysis/CostModel/RISCV/shuffle-interleave.ll
@@ -1,6 +1,8 @@
 ; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 2
-; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output -mtriple=riscv32 -mattr=+v | FileCheck --check-prefixes=CHECK,RV32 %s
-; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output -mtriple=riscv64 -mattr=+v | FileCheck --check-prefixes=CHECK,RV64 %s
+; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output -mtriple=riscv32 -mattr=+v | FileCheck --check-prefixes=CHECK,NOZVZIP,RV32 %s
+; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output -mtriple=riscv64 -mattr=+v | FileCheck --check-prefixes=CHECK,NOZVZIP,RV64 %s
+; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output -mtriple=riscv64 -mattr=+v,+zvfh,+experimental-zvzip  | FileCheck --check-prefixes=CHECK,ZVZIP,V %s
+; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output -mtriple=riscv64 -mattr=+zve32f,+zvfh,+zvl128b,+experimental-zvzip | FileCheck --check-prefixes=CHECK,ZVZIP,ZVE32 %s
 
 ; The mask here interleaves (%v1, %v0), not (%v0, %v1): it should still be cheap.
 define <4 x i8> @interleave2_v2i8(<2 x i8> %v0, <2 x i8> %v1) {
@@ -26,10 +28,20 @@ define <8 x i8> @interleave2_v8i8(<4 x i8> %v0, <4 x i8> %v1) {
 }
 
 define <8 x i32> @interleave2_v8i32(<4 x i32> %v0, <4 x i32> %v1) {
-; CHECK-LABEL: 'interleave2_v8i32'
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %concat = shufflevector <4 x i32> %v0, <4 x i32> %v1, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %res = shufflevector <8 x i32> %concat, <8 x i32> poison, <8 x i32> <i32 0, i32 4, i32 1, i32 5, i32 2, i32 6, i32 3, i32 7>
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %res
+; NOZVZIP-LABEL: 'interleave2_v8i32'
+; NOZVZIP-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %concat = shufflevector <4 x i32> %v0, <4 x i32> %v1, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
+; NOZVZIP-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %res = shufflevector <8 x i32> %concat, <8 x i32> poison, <8 x i32> <i32 0, i32 4, i32 1, i32 5, i32 2, i32 6, i32 3, i32 7>
+; NOZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %res
+;
+; V-LABEL: 'interleave2_v8i32'
+; V-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %concat = shufflevector <4 x i32> %v0, <4 x i32> %v1, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
+; V-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %res = shufflevector <8 x i32> %concat, <8 x i32> poison, <8 x i32> <i32 0, i32 4, i32 1, i32 5, i32 2, i32 6, i32 3, i32 7>
+; V-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %res
+;
+; ZVE32-LABEL: 'interleave2_v8i32'
+; ZVE32-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %concat = shufflevector <4 x i32> %v0, <4 x i32> %v1, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
+; ZVE32-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %res = shufflevector <8 x i32> %concat, <8 x i32> poison, <8 x i32> <i32 0, i32 4, i32 1, i32 5, i32 2, i32 6, i32 3, i32 7>
+; ZVE32-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %res
 ;
   %concat = shufflevector <4 x i32> %v0, <4 x i32> %v1, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
   %res = shufflevector <8 x i32> %concat, <8 x i32> poison, <8 x i32> <i32 0, i32 4, i32 1, i32 5, i32 2, i32 6, i32 3, i32 7>
@@ -47,6 +59,16 @@ define <8 x i64> @interleave2_v8i64(<4 x i64> %v0, <4 x i64> %v1) {
 ; RV64-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %concat = shufflevector <4 x i64> %v0, <4 x i64> %v1, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
 ; RV64-NEXT:  Cost Model: Found an estimated cost of 22 for instruction: %res = shufflevector <8 x i64> %concat, <8 x i64> poison, <8 x i32> <i32 0, i32 4, i32 1, i32 5, i32 2, i32 6, i32 3, i32 7>
 ; RV64-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %res
+;
+; V-LABEL: 'interleave2_v8i64'
+; V-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %concat = shufflevector <4 x i64> %v0, <4 x i64> %v1, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
+; V-NEXT:  Cost Model: Found an estimated cost of 22 for instruction: %res = shufflevector <8 x i64> %concat, <8 x i64> poison, <8 x i32> <i32 0, i32 4, i32 1, i32 5, i32 2, i32 6, i32 3, i32 7>
+; V-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %res
+;
+; ZVE32-LABEL: 'interleave2_v8i64'
+; ZVE32-NEXT:  Cost Model: Invalid cost for instruction: %concat = shufflevector <4 x i64> %v0, <4 x i64> %v1, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
+; ZVE32-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %res = shufflevector <8 x i64> %concat, <8 x i64> poison, <8 x i32> <i32 0, i32 4, i32 1, i32 5, i32 2, i32 6, i32 3, i32 7>
+; ZVE32-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %res
 ;
   %concat = shufflevector <4 x i64> %v0, <4 x i64> %v1, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
   %res = shufflevector <8 x i64> %concat, <8 x i64> poison, <8 x i32> <i32 0, i32 4, i32 1, i32 5, i32 2, i32 6, i32 3, i32 7>
@@ -98,3 +120,649 @@ define {<8 x i32>, <8 x i32>} @deinterleave_2_m2_dest(<16 x i32> %v) {
   %res1 = insertvalue {<8 x i32>, <8 x i32>} %res0, <8 x i32> %v1, 1
   ret {<8 x i32>, <8 x i32>} %res1
 }
+
+; Fixed-length interleave2 intrinsics.
+; TODO: we haven't supported the cost calculation of Zvzip in getShuffleCost
+; yet, so the cost of fixed vector may seem weird.
+
+define <2 x i32> @interleave2_intrinsic_v2i32(<1 x i32> %a, <1 x i32> %b) {
+; NOZVZIP-LABEL: 'interleave2_intrinsic_v2i32'
+; NOZVZIP-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %res = call <2 x i32> @llvm.vector.interleave2.v2i32(<1 x i32> %a, <1 x i32> %b)
+; NOZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i32> %res
+;
+; ZVZIP-LABEL: 'interleave2_intrinsic_v2i32'
+; ZVZIP-NEXT:  Cost Model: Found an estimated cost of 11 for instruction: %res = call <2 x i32> @llvm.vector.interleave2.v2i32(<1 x i32> %a, <1 x i32> %b)
+; ZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i32> %res
+;
+  %res = call <2 x i32> @llvm.vector.interleave2.v2i32(<1 x i32> %a, <1 x i32> %b)
+  ret <2 x i32> %res
+}
+
+define <2 x i64> @interleave2_intrinsic_v2i64(<1 x i64> %a, <1 x i64> %b) {
+; RV32-LABEL: 'interleave2_intrinsic_v2i64'
+; RV32-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %res = call <2 x i64> @llvm.vector.interleave2.v2i64(<1 x i64> %a, <1 x i64> %b)
+; RV32-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %res
+;
+; RV64-LABEL: 'interleave2_intrinsic_v2i64'
+; RV64-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %res = call <2 x i64> @llvm.vector.interleave2.v2i64(<1 x i64> %a, <1 x i64> %b)
+; RV64-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %res
+;
+; V-LABEL: 'interleave2_intrinsic_v2i64'
+; V-NEXT:  Cost Model: Found an estimated cost of 11 for instruction: %res = call <2 x i64> @llvm.vector.interleave2.v2i64(<1 x i64> %a, <1 x i64> %b)
+; V-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %res
+;
+; ZVE32-LABEL: 'interleave2_intrinsic_v2i64'
+; ZVE32-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %res = call <2 x i64> @llvm.vector.interleave2.v2i64(<1 x i64> %a, <1 x i64> %b)
+; ZVE32-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %res
+;
+  %res = call <2 x i64> @llvm.vector.interleave2.v2i64(<1 x i64> %a, <1 x i64> %b)
+  ret <2 x i64> %res
+}
+
+define <4 x i1> @interleave2_intrinsic_v4i1(<2 x i1> %a, <2 x i1> %b) {
+; CHECK-LABEL: 'interleave2_intrinsic_v4i1'
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 28 for instruction: %res = call <4 x i1> @llvm.vector.interleave2.v4i1(<2 x i1> %a, <2 x i1> %b)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i1> %res
+;
+  %res = call <4 x i1> @llvm.vector.interleave2.v4i1(<2 x i1> %a, <2 x i1> %b)
+  ret <4 x i1> %res
+}
+
+define <4 x i8> @interleave2_intrinsic_v4i8(<2 x i8> %a, <2 x i8> %b) {
+; NOZVZIP-LABEL: 'interleave2_intrinsic_v4i8'
+; NOZVZIP-NEXT:  Cost Model: Found an estimated cost of 18 for instruction: %res = call <4 x i8> @llvm.vector.interleave2.v4i8(<2 x i8> %a, <2 x i8> %b)
+; NOZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i8> %res
+;
+; ZVZIP-LABEL: 'interleave2_intrinsic_v4i8'
+; ZVZIP-NEXT:  Cost Model: Found an estimated cost of 11 for instruction: %res = call <4 x i8> @llvm.vector.interleave2.v4i8(<2 x i8> %a, <2 x i8> %b)
+; ZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i8> %res
+;
+  %res = call <4 x i8> @llvm.vector.interleave2.v4i8(<2 x i8> %a, <2 x i8> %b)
+  ret <4 x i8> %res
+}
+
+define <4 x i32> @interleave2_intrinsic_v4i32(<2 x i32> %a, <2 x i32> %b) {
+; NOZVZIP-LABEL: 'interleave2_intrinsic_v4i32'
+; NOZVZIP-NEXT:  Cost Model: Found an estimated cost of 18 for instruction: %res = call <4 x i32> @llvm.vector.interleave2.v4i32(<2 x i32> %a, <2 x i32> %b)
+; NOZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res
+;
+; ZVZIP-LABEL: 'interleave2_intrinsic_v4i32'
+; ZVZIP-NEXT:  Cost Model: Found an estimated cost of 11 for instruction: %res = call <4 x i32> @llvm.vector.interleave2.v4i32(<2 x i32> %a, <2 x i32> %b)
+; ZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res
+;
+  %res = call <4 x i32> @llvm.vector.interleave2.v4i32(<2 x i32> %a, <2 x i32> %b)
+  ret <4 x i32> %res
+}
+
+define <4 x i64> @interleave2_intrinsic_v4i64(<2 x i64> %a, <2 x i64> %b) {
+; RV32-LABEL: 'interleave2_intrinsic_v4i64'
+; RV32-NEXT:  Cost Model: Found an estimated cost of 57 for instruction: %res = call <4 x i64> @llvm.vector.interleave2.v4i64(<2 x i64> %a, <2 x i64> %b)
+; RV32-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %res
+;
+; RV64-LABEL: 'interleave2_intrinsic_v4i64'
+; RV64-NEXT:  Cost Model: Found an estimated cost of 21 for instruction: %res = call <4 x i64> @llvm.vector.interleave2.v4i64(<2 x i64> %a, <2 x i64> %b)
+; RV64-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %res
+;
+; V-LABEL: 'interleave2_intrinsic_v4i64'
+; V-NEXT:  Cost Model: Found an estimated cost of 11 for instruction: %res = call <4 x i64> @llvm.vector.interleave2.v4i64(<2 x i64> %a, <2 x i64> %b)
+; V-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %res
+;
+; ZVE32-LABEL: 'interleave2_intrinsic_v4i64'
+; ZVE32-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %res = call <4 x i64> @llvm.vector.interleave2.v4i64(<2 x i64> %a, <2 x i64> %b)
+; ZVE32-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %res
+;
+  %res = call <4 x i64> @llvm.vector.interleave2.v4i64(<2 x i64> %a, <2 x i64> %b)
+  ret <4 x i64> %res
+}
+
+define <8 x i16> @interleave2_intrinsic_v8i16(<4 x i16> %a, <4 x i16> %b) {
+; NOZVZIP-LABEL: 'interleave2_intrinsic_v8i16'
+; NOZVZIP-NEXT:  Cost Model: Found an estimated cost of 38 for instruction: %res = call <8 x i16> @llvm.vector.interleave2.v8i16(<4 x i16> %a, <4 x i16> %b)
+; NOZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %res
+;
+; ZVZIP-LABEL: 'interleave2_intrinsic_v8i16'
+; ZVZIP-NEXT:  Cost Model: Found an estimated cost of 11 for instruction: %res = call <8 x i16> @llvm.vector.interleave2.v8i16(<4 x i16> %a, <4 x i16> %b)
+; ZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %res
+;
+  %res = call <8 x i16> @llvm.vector.interleave2.v8i16(<4 x i16> %a, <4 x i16> %b)
+  ret <8 x i16> %res
+}
+
+define <8 x i32> @interleave2_intrinsic_v8i32(<4 x i32> %a, <4 x i32> %b) {
+; NOZVZIP-LABEL: 'interleave2_intrinsic_v8i32'
+; NOZVZIP-NEXT:  Cost Model: Found an estimated cost of 45 for instruction: %res = call <8 x i32> @llvm.vector.interleave2.v8i32(<4 x i32> %a, <4 x i32> %b)
+; NOZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %res
+;
+; ZVZIP-LABEL: 'interleave2_intrinsic_v8i32'
+; ZVZIP-NEXT:  Cost Model: Found an estimated cost of 11 for instruction: %res = call <8 x i32> @llvm.vector.interleave2.v8i32(<4 x i32> %a, <4 x i32> %b)
+; ZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %res
+;
+  %res = call <8 x i32> @llvm.vector.interleave2.v8i32(<4 x i32> %a, <4 x i32> %b)
+  ret <8 x i32> %res
+}
+
+define <8 x i32> @interleave2_intrinsic_v8i32_poison(<4 x i32> %a) {
+; CHECK-LABEL: 'interleave2_intrinsic_v8i32_poison'
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 34 for instruction: %res = call <8 x i32> @llvm.vector.interleave2.v8i32(<4 x i32> %a, <4 x i32> poison)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %res
+;
+  %res = call <8 x i32> @llvm.vector.interleave2.v8i32(<4 x i32> %a, <4 x i32> poison)
+  ret <8 x i32> %res
+}
+
+define <16 x i32> @interleave2_intrinsic_v16i32(<8 x i32> %a, <8 x i32> %b) {
+; NOZVZIP-LABEL: 'interleave2_intrinsic_v16i32'
+; NOZVZIP-NEXT:  Cost Model: Found an estimated cost of 93 for instruction: %res = call <16 x i32> @llvm.vector.interleave2.v16i32(<8 x i32> %a, <8 x i32> %b)
+; NOZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %res
+;
+; ZVZIP-LABEL: 'interleave2_intrinsic_v16i32'
+; ZVZIP-NEXT:  Cost Model: Found an estimated cost of 19 for instruction: %res = call <16 x i32> @llvm.vector.interleave2.v16i32(<8 x i32> %a, <8 x i32> %b)
+; ZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %res
+;
+  %res = call <16 x i32> @llvm.vector.interleave2.v16i32(<8 x i32> %a, <8 x i32> %b)
+  ret <16 x i32> %res
+}
+
+define <32 x i32> @interleave2_intrinsic_v32i32(<16 x i32> %a, <16 x i32> %b) {
+; NOZVZIP-LABEL: 'interleave2_intrinsic_v32i32'
+; NOZVZIP-NEXT:  Cost Model: Found an estimated cost of 189 for instruction: %res = call <32 x i32> @llvm.vector.interleave2.v32i32(<16 x i32> %a, <16 x i32> %b)
+; NOZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i32> %res
+;
+; ZVZIP-LABEL: 'interleave2_intrinsic_v32i32'
+; ZVZIP-NEXT:  Cost Model: Found an estimated cost of 47 for instruction: %res = call <32 x i32> @llvm.vector.interleave2.v32i32(<16 x i32> %a, <16 x i32> %b)
+; ZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i32> %res
+;
+  %res = call <32 x i32> @llvm.vector.interleave2.v32i32(<16 x i32> %a, <16 x i32> %b)
+  ret <32 x i32> %res
+}
+
+; Scalable interleave2 intrinsics.
+
+define <vscale x 2 x i32> @interleave2_intrinsic_nxv2i32(<vscale x 1 x i32> %a, <vscale x 1 x i32> %b) {
+; NOZVZIP-LABEL: 'interleave2_intrinsic_nxv2i32'
+; NOZVZIP-NEXT:  Cost Model: Invalid cost for instruction: %res = call <vscale x 2 x i32> @llvm.vector.interleave2.nxv2i32(<vscale x 1 x i32> %a, <vscale x 1 x i32> %b)
+; NOZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <vscale x 2 x i32> %res
+;
+; V-LABEL: 'interleave2_intrinsic_nxv2i32'
+; V-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %res = call <vscale x 2 x i32> @llvm.vector.interleave2.nxv2i32(<vscale x 1 x i32> %a, <vscale x 1 x i32> %b)
+; V-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <vscale x 2 x i32> %res
+;
+; ZVE32-LABEL: 'interleave2_intrinsic_nxv2i32'
+; ZVE32-NEXT:  Cost Model: Invalid cost for instruction: %res = call <vscale x 2 x i32> @llvm.vector.interleave2.nxv2i32(<vscale x 1 x i32> %a, <vscale x 1 x i32> %b)
+; ZVE32-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <vscale x 2 x i32> %res
+;
+  %res = call <vscale x 2 x i32> @llvm.vector.interleave2.nxv2i32(<vscale x 1 x i32> %a, <vscale x 1 x i32> %b)
+  ret <vscale x 2 x i32> %res
+}
+
+define <vscale x 2 x i64> @interleave2_intrinsic_nxv2i64(<vscale x 1 x i64> %a, <vscale x 1 x i64> %b) {
+; NOZVZIP-LABEL: 'interleave2_intrinsic_nxv2i64'
+; NOZVZIP-NEXT:  Cost Model: Invalid cost for instruction: %res = call <vscale x 2 x i64> @llvm.vector.interleave2.nxv2i64(<vscale x 1 x i64> %a, <vscale x 1 x i64> %b)
+; NOZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <vscale x 2 x i64> %res
+;
+; V-LABEL: 'interleave2_intrinsic_nxv2i64'
+; V-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %res = call <vscale x 2 x i64> @llvm.vector.interleave2.nxv2i64(<vscale x 1 x i64> %a, <vscale x 1 x i64> %b)
+; V-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <vscale x 2 x i64> %res
+;
+; ZVE32-LABEL: 'interleave2_intrinsic_nxv2i64'
+; ZVE32-NEXT:  Cost Model: Invalid cost for instruction: %res = call <vscale x 2 x i64> @llvm.vector.interleave2.nxv2i64(<vscale x 1 x i64> %a, <vscale x 1 x i64> %b)
+; ZVE32-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <vscale x 2 x i64> %res
+;
+  %res = call <vscale x 2 x i64> @llvm.vector.interleave2.nxv2i64(<vscale x 1 x i64> %a, <vscale x 1 x i64> %b)
+  ret <vscale x 2 x i64> %res
+}
+
+define <vscale x 4 x i32> @interleave2_intrinsic_nxv4i32(<vscale x 2 x i32> %a, <vscale x 2 x i32> %b) {
+; NOZVZIP-LABEL: 'interleave2_intrinsic_nxv4i32'
+; NOZVZIP-NEXT:  Cost Model: Invalid cost for instruction: %res = call <vscale x 4 x i32> @llvm.vector.interleave2.nxv4i32(<vscale x 2 x i32> %a, <vscale x 2 x i32> %b)
+; NOZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <vscale x 4 x i32> %res
+;
+; ZVZIP-LABEL: 'interleave2_intrinsic_nxv4i32'
+; ZVZIP-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %res = call <vscale x 4 x i32> @llvm.vector.interleave2.nxv4i32(<vscale x 2 x i32> %a, <vscale x 2 x i32> %b)
+; ZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <vscale x 4 x i32> %res
+;
+  %res = call <vscale x 4 x i32> @llvm.vector.interleave2.nxv4i32(<vscale x 2 x i32> %a, <vscale x 2 x i32> %b)
+  ret <vscale x 4 x i32> %res
+}
+
+define <vscale x 4 x double> @interleave2_intrinsic_nxv4f64(<vscale x 2 x double> %a, <vscale x 2 x double> %b) {
+; NOZVZIP-LABEL: 'interleave2_intrinsic_nxv4f64'
+; NOZVZIP-NEXT:  Cost Model: Invalid cost for instruction: %res = call <vscale x 4 x double> @llvm.vector.interleave2.nxv4f64(<vscale x 2 x double> %a, <vscale x 2 x double> %b)
+; NOZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <vscale x 4 x double> %res
+;
+; V-LABEL: 'interleave2_intrinsic_nxv4f64'
+; V-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %res = call <vscale x 4 x double> @llvm.vector.interleave2.nxv4f64(<vscale x 2 x double> %a, <vscale x 2 x double> %b)
+; V-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <vscale x 4 x double> %res
+;
+; ZVE32-LABEL: 'interleave2_intrinsic_nxv4f64'
+; ZVE32-NEXT:  Cost Model: Invalid cost for instruction: %res = call <vscale x 4 x double> @llvm.vector.interleave2.nxv4f64(<vscale x 2 x double> %a, <vscale x 2 x double> %b)
+; ZVE32-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <vscale x 4 x double> %res
+;
+  %res = call <vscale x 4 x double> @llvm.vector.interleave2.nxv4f64(<vscale x 2 x double> %a, <vscale x 2 x double> %b)
+  ret <vscale x 4 x double> %res
+}
+
+define <vscale x 8 x half> @interleave2_intrinsic_nxv8f16(<vscale x 4 x half> %a, <vscale x 4 x half> %b) {
+; NOZVZIP-LABEL: 'interleave2_intrinsic_nxv8f16'
+; NOZVZIP-NEXT:  Cost Model: Invalid cost for instruction: %res = call <vscale x 8 x half> @llvm.vector.interleave2.nxv8f16(<vscale x 4 x half> %a, <vscale x 4 x half> %b)
+; NOZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <vscale x 8 x half> %res
+;
+; ZVZIP-LABEL: 'interleave2_intrinsic_nxv8f16'
+; ZVZIP-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %res = call <vscale x 8 x half> @llvm.vector.interleave2.nxv8f16(<vscale x 4 x half> %a, <vscale x 4 x half> %b)
+; ZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <vscale x 8 x half> %res
+;
+  %res = call <vscale x 8 x half> @llvm.vector.interleave2.nxv8f16(<vscale x 4 x half> %a, <vscale x 4 x half> %b)
+  ret <vscale x 8 x half> %res
+}
+
+define <vscale x 8 x i32> @interleave2_intrinsic_nxv8i32(<vscale x 4 x i32> %a, <vscale x 4 x i32> %b) {
+; NOZVZIP-LABEL: 'interleave2_intrinsic_nxv8i32'
+; NOZVZIP-NEXT:  Cost Model: Invalid cost for instruction: %res = call <vscale x 8 x i32> @llvm.vector.interleave2.nxv8i32(<vscale x 4 x i32> %a, <vscale x 4 x i32> %b)
+; NOZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <vscale x 8 x i32> %res
+;
+; ZVZIP-LABEL: 'interleave2_intrinsic_nxv8i32'
+; ZVZIP-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %res = call <vscale x 8 x i32> @llvm.vector.interleave2.nxv8i32(<vscale x 4 x i32> %a, <vscale x 4 x i32> %b)
+; ZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <vscale x 8 x i32> %res
+;
+  %res = call <vscale x 8 x i32> @llvm.vector.interleave2.nxv8i32(<vscale x 4 x i32> %a, <vscale x 4 x i32> %b)
+  ret <vscale x 8 x i32> %res
+}
+
+define <vscale x 8 x i32> @interleave2_intrinsic_nxv8i32_poison(<vscale x 4 x i32> %a) {
+; CHECK-LABEL: 'interleave2_intrinsic_nxv8i32_poison'
+; CHECK-NEXT:  Cost Model: Invalid cost for instruction: %res = call <vscale x 8 x i32> @llvm.vector.interleave2.nxv8i32(<vscale x 4 x i32> %a, <vscale x 4 x i32> poison)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <vscale x 8 x i32> %res
+;
+  %res = call <vscale x 8 x i32> @llvm.vector.interleave2.nxv8i32(<vscale x 4 x i32> %a, <vscale x 4 x i32> poison)
+  ret <vscale x 8 x i32> %res
+}
+
+define <vscale x 8 x float> @interleave2_intrinsic_nxv8f32(<vscale x 4 x float> %a, <vscale x 4 x float> %b) {
+; NOZVZIP-LABEL: 'interleave2_intrinsic_nxv8f32'
+; NOZVZIP-NEXT:  Cost Model: Invalid cost for instruction: %res = call <vscale x 8 x float> @llvm.vector.interleave2.nxv8f32(<vscale x 4 x float> %a, <vscale x 4 x float> %b)
+; NOZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <vscale x 8 x float> %res
+;
+; ZVZIP-LABEL: 'interleave2_intrinsic_nxv8f32'
+; ZVZIP-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %res = call <vscale x 8 x float> @llvm.vector.interleave2.nxv8f32(<vscale x 4 x float> %a, <vscale x 4 x float> %b)
+; ZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <vscale x 8 x float> %res
+;
+  %res = call <vscale x 8 x float> @llvm.vector.interleave2.nxv8f32(<vscale x 4 x float> %a, <vscale x 4 x float> %b)
+  ret <vscale x 8 x float> %res
+}
+
+define <vscale x 16 x i32> @interleave2_intrinsic_nxv16i32(<vscale x 8 x i32> %a, <vscale x 8 x i32> %b) {
+; NOZVZIP-LABEL: 'interleave2_intrinsic_nxv16i32'
+; NOZVZIP-NEXT:  Cost Model: Invalid cost for instruction: %res = call <vscale x 16 x i32> @llvm.vector.interleave2.nxv16i32(<vscale x 8 x i32> %a, <vscale x 8 x i32> %b)
+; NOZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <vscale x 16 x i32> %res
+;
+; ZVZIP-LABEL: 'interleave2_intrinsic_nxv16i32'
+; ZVZIP-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %res = call <vscale x 16 x i32> @llvm.vector.interleave2.nxv16i32(<vscale x 8 x i32> %a, <vscale x 8 x i32> %b)
+; ZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <vscale x 16 x i32> %res
+;
+  %res = call <vscale x 16 x i32> @llvm.vector.interleave2.nxv16i32(<vscale x 8 x i32> %a, <vscale x 8 x i32> %b)
+  ret <vscale x 16 x i32> %res
+}
+
+define <vscale x 16 x i64> @interleave2_intrinsic_nxv16i64(<vscale x 8 x i64> %a, <vscale x 8 x i64> %b) {
+; NOZVZIP-LABEL: 'interleave2_intrinsic_nxv16i64'
+; NOZVZIP-NEXT:  Cost Model: Invalid cost for instruction: %res = call <vscale x 16 x i64> @llvm.vector.interleave2.nxv16i64(<vscale x 8 x i64> %a, <vscale x 8 x i64> %b)
+; NOZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <vscale x 16 x i64> %res
+;
+; V-LABEL: 'interleave2_intrinsic_nxv16i64'
+; V-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %res = call <vscale x 16 x i64> @llvm.vector.interleave2.nxv16i64(<vscale x 8 x i64> %a, <vscale x 8 x i64> %b)
+; V-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <vscale x 16 x i64> %res
+;
+; ZVE32-LABEL: 'interleave2_intrinsic_nxv16i64'
+; ZVE32-NEXT:  Cost Model: Invalid cost for instruction: %res = call <vscale x 16 x i64> @llvm.vector.interleave2.nxv16i64(<vscale x 8 x i64> %a, <vscale x 8 x i64> %b)
+; ZVE32-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <vscale x 16 x i64> %res
+;
+  %res = call <vscale x 16 x i64> @llvm.vector.interleave2.nxv16i64(<vscale x 8 x i64> %a, <vscale x 8 x i64> %b)
+  ret <vscale x 16 x i64> %res
+}
+
+define <vscale x 32 x i32> @interleave2_intrinsic_nxv32i32(<vscale x 16 x i32> %a, <vscale x 16 x i32> %b) {
+; NOZVZIP-LABEL: 'interleave2_intrinsic_nxv32i32'
+; NOZVZIP-NEXT:  Cost Model: Invalid cost for instruction: %res = call <vscale x 32 x i32> @llvm.vector.interleave2.nxv32i32(<vscale x 16 x i32> %a, <vscale x 16 x i32> %b)
+; NOZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <vscale x 32 x i32> %res
+;
+; ZVZIP-LABEL: 'interleave2_intrinsic_nxv32i32'
+; ZVZIP-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %res = call <vscale x 32 x i32> @llvm.vector.interleave2.nxv32i32(<vscale x 16 x i32> %a, <vscale x 16 x i32> %b)
+; ZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <vscale x 32 x i32> %res
+;
+  %res = call <vscale x 32 x i32> @llvm.vector.interleave2.nxv32i32(<vscale x 16 x i32> %a, <vscale x 16 x i32> %b)
+  ret <vscale x 32 x i32> %res
+}
+
+define <vscale x 64 x i32> @interleave2_intrinsic_nxv64i32(<vscale x 32 x i32> %a, <vscale x 32 x i32> %b) {
+; NOZVZIP-LABEL: 'interleave2_intrinsic_nxv64i32'
+; NOZVZIP-NEXT:  Cost Model: Invalid cost for instruction: %res = call <vscale x 64 x i32> @llvm.vector.interleave2.nxv64i32(<vscale x 32 x i32> %a, <vscale x 32 x i32> %b)
+; NOZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <vscale x 64 x i32> %res
+;
+; ZVZIP-LABEL: 'interleave2_intrinsic_nxv64i32'
+; ZVZIP-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %res = call <vscale x 64 x i32> @llvm.vector.interleave2.nxv64i32(<vscale x 32 x i32> %a, <vscale x 32 x i32> %b)
+; ZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <vscale x 64 x i32> %res
+;
+  %res = call <vscale x 64 x i32> @llvm.vector.interleave2.nxv64i32(<vscale x 32 x i32> %a, <vscale x 32 x i32> %b)
+  ret <vscale x 64 x i32> %res
+}
+
+; Fixed-length deinterleave2 intrinsics.
+
+define { <1 x i32>, <1 x i32> } @deinterleave2_intrinsic_v2i32(<2 x i32> %v) {
+; NOZVZIP-LABEL: 'deinterleave2_intrinsic_v2i32'
+; NOZVZIP-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %res = call { <1 x i32>, <1 x i32> } @llvm.vector.deinterleave2.v2i32(<2 x i32> %v)
+; NOZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret { <1 x i32>, <1 x i32> } %res
+;
+; ZVZIP-LABEL: 'deinterleave2_intrinsic_v2i32'
+; ZVZIP-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %res = call { <1 x i32>, <1 x i32> } @llvm.vector.deinterleave2.v2i32(<2 x i32> %v)
+; ZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret { <1 x i32>, <1 x i32> } %res
+;
+  %res = call { <1 x i32>, <1 x i32> } @llvm.vector.deinterleave2.v2i32(<2 x i32> %v)
+  ret { <1 x i32>, <1 x i32> } %res
+}
+
+define { <1 x i64>, <1 x i64> } @deinterleave2_intrinsic_v2i64(<2 x i64> %v) {
+; RV32-LABEL: 'deinterleave2_intrinsic_v2i64'
+; RV32-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %res = call { <1 x i64>, <1 x i64> } @llvm.vector.deinterleave2.v2i64(<2 x i64> %v)
+; RV32-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret { <1 x i64>, <1 x i64> } %res
+;
+; RV64-LABEL: 'deinterleave2_intrinsic_v2i64'
+; RV64-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %res = call { <1 x i64>, <1 x i64> } @llvm.vector.deinterleave2.v2i64(<2 x i64> %v)
+; RV64-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret { <1 x i64>, <1 x i64> } %res
+;
+; V-LABEL: 'deinterleave2_intrinsic_v2i64'
+; V-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %res = call { <1 x i64>, <1 x i64> } @llvm.vector.deinterleave2.v2i64(<2 x i64> %v)
+; V-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret { <1 x i64>, <1 x i64> } %res
+;
+; ZVE32-LABEL: 'deinterleave2_intrinsic_v2i64'
+; ZVE32-NEXT:  Cost Model: Invalid cost for instruction: %res = call { <1 x i64>, <1 x i64> } @llvm.vector.deinterleave2.v2i64(<2 x i64> %v)
+; ZVE32-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret { <1 x i64>, <1 x i64> } %res
+;
+  %res = call { <1 x i64>, <1 x i64> } @llvm.vector.deinterleave2.v2i64(<2 x i64> %v)
+  ret { <1 x i64>, <1 x i64> } %res
+}
+
+define { <2 x i1>, <2 x i1> } @deinterleave2_intrinsic_v4i1(<4 x i1> %v) {
+; CHECK-LABEL: 'deinterleave2_intrinsic_v4i1'
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %res = call { <2 x i1>, <2 x i1> } @llvm.vector.deinterleave2.v4i1(<4 x i1> %v)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret { <2 x i1>, <2 x i1> } %res
+;
+  %res = call { <2 x i1>, <2 x i1> } @llvm.vector.deinterleave2.v4i1(<4 x i1> %v)
+  ret { <2 x i1>, <2 x i1> } %res
+}
+
+define { <2 x i8>, <2 x i8> } @deinterleave2_intrinsic_v4i8(<4 x i8> %v) {
+; NOZVZIP-LABEL: 'deinterleave2_intrinsic_v4i8'
+; NOZVZIP-NEXT:  Cost Model: Found an estimated cost of 19 for instruction: %res = call { <2 x i8>, <2 x i8> } @llvm.vector.deinterleave2.v4i8(<4 x i8> %v)
+; NOZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret { <2 x i8>, <2 x i8> } %res
+;
+; ZVZIP-LABEL: 'deinterleave2_intrinsic_v4i8'
+; ZVZIP-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %res = call { <2 x i8>, <2 x i8> } @llvm.vector.deinterleave2.v4i8(<4 x i8> %v)
+; ZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret { <2 x i8>, <2 x i8> } %res
+;
+  %res = call { <2 x i8>, <2 x i8> } @llvm.vector.deinterleave2.v4i8(<4 x i8> %v)
+  ret { <2 x i8>, <2 x i8> } %res
+}
+
+define { <2 x i32>, <2 x i32> } @deinterleave2_intrinsic_v4i32(<4 x i32> %v) {
+; NOZVZIP-LABEL: 'deinterleave2_intrinsic_v4i32'
+; NOZVZIP-NEXT:  Cost Model: Found an estimated cost of 19 for instruction: %res = call { <2 x i32>, <2 x i32> } @llvm.vector.deinterleave2.v4i32(<4 x i32> %v)
+; NOZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret { <2 x i32>, <2 x i32> } %res
+;
+; V-LABEL: 'deinterleave2_intrinsic_v4i32'
+; V-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %res = call { <2 x i32>, <2 x i32> } @llvm.vector.deinterleave2.v4i32(<4 x i32> %v)
+; V-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret { <2 x i32>, <2 x i32> } %res
+;
+; ZVE32-LABEL: 'deinterleave2_intrinsic_v4i32'
+; ZVE32-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %res = call { <2 x i32>, <2 x i32> } @llvm.vector.deinterleave2.v4i32(<4 x i32> %v)
+; ZVE32-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret { <2 x i32>, <2 x i32> } %res
+;
+  %res = call { <2 x i32>, <2 x i32> } @llvm.vector.deinterleave2.v4i32(<4 x i32> %v)
+  ret { <2 x i32>, <2 x i32> } %res
+}
+
+define { <2 x i64>, <2 x i64> } @deinterleave2_intrinsic_v4i64(<4 x i64> %v) {
+; RV32-LABEL: 'deinterleave2_intrinsic_v4i64'
+; RV32-NEXT:  Cost Model: Found an estimated cost of 43 for instruction: %res = call { <2 x i64>, <2 x i64> } @llvm.vector.deinterleave2.v4i64(<4 x i64> %v)
+; RV32-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret { <2 x i64>, <2 x i64> } %res
+;
+; RV64-LABEL: 'deinterleave2_intrinsic_v4i64'
+; RV64-NEXT:  Cost Model: Found an estimated cost of 19 for instruction: %res = call { <2 x i64>, <2 x i64> } @llvm.vector.deinterleave2.v4i64(<4 x i64> %v)
+; RV64-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret { <2 x i64>, <2 x i64> } %res
+;
+; V-LABEL: 'deinterleave2_intrinsic_v4i64'
+; V-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %res = call { <2 x i64>, <2 x i64> } @llvm.vector.deinterleave2.v4i64(<4 x i64> %v)
+; V-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret { <2 x i64>, <2 x i64> } %res
+;
+; ZVE32-LABEL: 'deinterleave2_intrinsic_v4i64'
+; ZVE32-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %res = call { <2 x i64>, <2 x i64> } @llvm.vector.deinterleave2.v4i64(<4 x i64> %v)
+; ZVE32-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret { <2 x i64>, <2 x i64> } %res
+;
+  %res = call { <2 x i64>, <2 x i64> } @llvm.vector.deinterleave2.v4i64(<4 x i64> %v)
+  ret { <2 x i64>, <2 x i64> } %res
+}
+
+define { <4 x i16>, <4 x i16> } @deinterleave2_intrinsic_v8i16(<8 x i16> %v) {
+; NOZVZIP-LABEL: 'deinterleave2_intrinsic_v8i16'
+; NOZVZIP-NEXT:  Cost Model: Found an estimated cost of 39 for instruction: %res = call { <4 x i16>, <4 x i16> } @llvm.vector.deinterleave2.v8i16(<8 x i16> %v)
+; NOZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret { <4 x i16>, <4 x i16> } %res
+;
+; ZVZIP-LABEL: 'deinterleave2_intrinsic_v8i16'
+; ZVZIP-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %res = call { <4 x i16>, <4 x i16> } @llvm.vector.deinterleave2.v8i16(<8 x i16> %v)
+; ZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret { <4 x i16>, <4 x i16> } %res
+;
+  %res = call { <4 x i16>, <4 x i16> } @llvm.vector.deinterleave2.v8i16(<8 x i16> %v)
+  ret { <4 x i16>, <4 x i16> } %res
+}
+
+define { <4 x i32>, <4 x i32> } @deinterleave2_intrinsic_v8i32(<8 x i32> %v) {
+; NOZVZIP-LABEL: 'deinterleave2_intrinsic_v8i32'
+; NOZVZIP-NEXT:  Cost Model: Found an estimated cost of 39 for instruction: %res = call { <4 x i32>, <4 x i32> } @llvm.vector.deinterleave2.v8i32(<8 x i32> %v)
+; NOZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret { <4 x i32>, <4 x i32> } %res
+;
+; V-LABEL: 'deinterleave2_intrinsic_v8i32'
+; V-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %res = call { <4 x i32>, <4 x i32> } @llvm.vector.deinterleave2.v8i32(<8 x i32> %v)
+; V-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret { <4 x i32>, <4 x i32> } %res
+;
+; ZVE32-LABEL: 'deinterleave2_intrinsic_v8i32'
+; ZVE32-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %res = call { <4 x i32>, <4 x i32> } @llvm.vector.deinterleave2.v8i32(<8 x i32> %v)
+; ZVE32-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret { <4 x i32>, <4 x i32> } %res
+;
+  %res = call { <4 x i32>, <4 x i32> } @llvm.vector.deinterleave2.v8i32(<8 x i32> %v)
+  ret { <4 x i32>, <4 x i32> } %res
+}
+
+define { <4 x i64>, <4 x i64> } @deinterleave2_intrinsic_v8i64(<8 x i64> %v) {
+; RV32-LABEL: 'deinterleave2_intrinsic_v8i64'
+; RV32-NEXT:  Cost Model: Found an estimated cost of 165 for instruction: %res = call { <4 x i64>, <4 x i64> } @llvm.vector.deinterleave2.v8i64(<8 x i64> %v)
+; RV32-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret { <4 x i64>, <4 x i64> } %res
+;
+; RV64-LABEL: 'deinterleave2_intrinsic_v8i64'
+; RV64-NEXT:  Cost Model: Found an estimated cost of 45 for instruction: %res = call { <4 x i64>, <4 x i64> } @llvm.vector.deinterleave2.v8i64(<8 x i64> %v)
+; RV64-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret { <4 x i64>, <4 x i64> } %res
+;
+; V-LABEL: 'deinterleave2_intrinsic_v8i64'
+; V-NEXT:  Cost Model: Found an estimated cost of 44 for instruction: %res = call { <4 x i64>, <4 x i64> } @llvm.vector.deinterleave2.v8i64(<8 x i64> %v)
+; V-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret { <4 x i64>, <4 x i64> } %res
+;
+; ZVE32-LABEL: 'deinterleave2_intrinsic_v8i64'
+; ZVE32-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %res = call { <4 x i64>, <4 x i64> } @llvm.vector.deinterleave2.v8i64(<8 x i64> %v)
+; ZVE32-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret { <4 x i64>, <4 x i64> } %res
+;
+  %res = call { <4 x i64>, <4 x i64> } @llvm.vector.deinterleave2.v8i64(<8 x i64> %v)
+  ret { <4 x i64>, <4 x i64> } %res
+}
+
+define { <8 x i32>, <8 x i32> } @deinterleave2_intrinsic_v16i32(<16 x i32> %v) {
+; NOZVZIP-LABEL: 'deinterleave2_intrinsic_v16i32'
+; NOZVZIP-NEXT:  Cost Model: Found an estimated cost of 93 for instruction: %res = call { <8 x i32>, <8 x i32> } @llvm.vector.deinterleave2.v16i32(<16 x i32> %v)
+; NOZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret { <8 x i32>, <8 x i32> } %res
+;
+; V-LABEL: 'deinterleave2_intrinsic_v16i32'
+; V-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %res = call { <8 x i32>, <8 x i32> } @llvm.vector.deinterleave2.v16i32(<16 x i32> %v)
+; V-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret { <8 x i32>, <8 x i32> } %res
+;
+; ZVE32-LABEL: 'deinterleave2_intrinsic_v16i32'
+; ZVE32-NEXT:  Cost Model: Found an estimated cost of 44 for instruction: %res = call { <8 x i32>, <8 x i32> } @llvm.vector.deinterleave2.v16i32(<16 x i32> %v)
+; ZVE32-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret { <8 x i32>, <8 x i32> } %res
+;
+  %res = call { <8 x i32>, <8 x i32> } @llvm.vector.deinterleave2.v16i32(<16 x i32> %v)
+  ret { <8 x i32>, <8 x i32> } %res
+}
+
+define { <16 x i32>, <16 x i32> } @deinterleave2_intrinsic_v32i32(<32 x i32> %v) {
+; NOZVZIP-LABEL: 'deinterleave2_intrinsic_v32i32'
+; NOZVZIP-NEXT:  Cost Model: Found an estimated cost of 189 for instruction: %res = call { <16 x i32>, <16 x i32> } @llvm.vector.deinterleave2.v32i32(<32 x i32> %v)
+; NOZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret { <16 x i32>, <16 x i32> } %res
+;
+; V-LABEL: 'deinterleave2_intrinsic_v32i32'
+; V-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %res = call { <16 x i32>, <16 x i32> } @llvm.vector.deinterleave2.v32i32(<32 x i32> %v)
+; V-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret { <16 x i32>, <16 x i32> } %res
+;
+; ZVE32-LABEL: 'deinterleave2_intrinsic_v32i32'
+; ZVE32-NEXT:  Cost Model: Found an estimated cost of 148 for instruction: %res = call { <16 x i32>, <16 x i32> } @llvm.vector.deinterleave2.v32i32(<32 x i32> %v)
+; ZVE32-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret { <16 x i32>, <16 x i32> } %res
+;
+  %res = call { <16 x i32>, <16 x i32> } @llvm.vector.deinterleave2.v32i32(<32 x i32> %v)
+  ret { <16 x i32>, <16 x i32> } %res
+}
+
+; Scalable deinterleave2 intrinsics.
+
+define { <vscale x 1 x i32>, <vscale x 1 x i32> } @deinterleave2_intrinsic_nxv2i32(<vscale x 2 x i32> %v) {
+; NOZVZIP-LABEL: 'deinterleave2_intrinsic_nxv2i32'
+; NOZVZIP-NEXT:  Cost Model: Invalid cost for instruction: %res = call { <vscale x 1 x i32>, <vscale x 1 x i32> } @llvm.vector.deinterleave2.nxv2i32(<vscale x 2 x i32> %v)
+; NOZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret { <vscale x 1 x i32>, <vscale x 1 x i32> } %res
+;
+; ZVZIP-LABEL: 'deinterleave2_intrinsic_nxv2i32'
+; ZVZIP-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %res = call { <vscale x 1 x i32>, <vscale x 1 x i32> } @llvm.vector.deinterleave2.nxv2i32(<vscale x 2 x i32> %v)
+; ZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret { <vscale x 1 x i32>, <vscale x 1 x i32> } %res
+;
+  %res = call { <vscale x 1 x i32>, <vscale x 1 x i32> } @llvm.vector.deinterleave2.nxv2i32(<vscale x 2 x i32> %v)
+  ret { <vscale x 1 x i32>, <vscale x 1 x i32> } %res
+}
+
+define { <vscale x 2 x i32>, <vscale x 2 x i32> } @deinterleave2_intrinsic_nxv4i32(<vscale x 4 x i32> %v) {
+; NOZVZIP-LABEL: 'deinterleave2_intrinsic_nxv4i32'
+; NOZVZIP-NEXT:  Cost Model: Invalid cost for instruction: %res = call { <vscale x 2 x i32>, <vscale x 2 x i32> } @llvm.vector.deinterleave2.nxv4i32(<vscale x 4 x i32> %v)
+; NOZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret { <vscale x 2 x i32>, <vscale x 2 x i32> } %res
+;
+; ZVZIP-LABEL: 'deinterleave2_intrinsic_nxv4i32'
+; ZVZIP-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %res = call { <vscale x 2 x i32>, <vscale x 2 x i32> } @llvm.vector.deinterleave2.nxv4i32(<vscale x 4 x i32> %v)
+; ZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret { <vscale x 2 x i32>, <vscale x 2 x i32> } %res
+;
+  %res = call { <vscale x 2 x i32>, <vscale x 2 x i32> } @llvm.vector.deinterleave2.nxv4i32(<vscale x 4 x i32> %v)
+  ret { <vscale x 2 x i32>, <vscale x 2 x i32> } %res
+}
+
+define { <vscale x 2 x double>, <vscale x 2 x double> } @deinterleave2_intrinsic_nxv4f64(<vscale x 4 x double> %v) {
+; NOZVZIP-LABEL: 'deinterleave2_intrinsic_nxv4f64'
+; NOZVZIP-NEXT:  Cost Model: Invalid cost for instruction: %res = call { <vscale x 2 x double>, <vscale x 2 x double> } @llvm.vector.deinterleave2.nxv4f64(<vscale x 4 x double> %v)
+; NOZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret { <vscale x 2 x double>, <vscale x 2 x double> } %res
+;
+; V-LABEL: 'deinterleave2_intrinsic_nxv4f64'
+; V-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %res = call { <vscale x 2 x double>, <vscale x 2 x double> } @llvm.vector.deinterleave2.nxv4f64(<vscale x 4 x double> %v)
+; V-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret { <vscale x 2 x double>, <vscale x 2 x double> } %res
+;
+; ZVE32-LABEL: 'deinterleave2_intrinsic_nxv4f64'
+; ZVE32-NEXT:  Cost Model: Invalid cost for instruction: %res = call { <vscale x 2 x double>, <vscale x 2 x double> } @llvm.vector.deinterleave2.nxv4f64(<vscale x 4 x double> %v)
+; ZVE32-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret { <vscale x 2 x double>, <vscale x 2 x double> } %res
+;
+  %res = call { <vscale x 2 x double>, <vscale x 2 x double> } @llvm.vector.deinterleave2.nxv4f64(<vscale x 4 x double> %v)
+  ret { <vscale x 2 x double>, <vscale x 2 x double> } %res
+}
+
+define { <vscale x 4 x half>, <vscale x 4 x half> } @deinterleave2_intrinsic_nxv8f16(<vscale x 8 x half> %v) {
+; NOZVZIP-LABEL: 'deinterleave2_intrinsic_nxv8f16'
+; NOZVZIP-NEXT:  Cost Model: Invalid cost for instruction: %res = call { <vscale x 4 x half>, <vscale x 4 x half> } @llvm.vector.deinterleave2.nxv8f16(<vscale x 8 x half> %v)
+; NOZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret { <vscale x 4 x half>, <vscale x 4 x half> } %res
+;
+; ZVZIP-LABEL: 'deinterleave2_intrinsic_nxv8f16'
+; ZVZIP-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %res = call { <vscale x 4 x half>, <vscale x 4 x half> } @llvm.vector.deinterleave2.nxv8f16(<vscale x 8 x half> %v)
+; ZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret { <vscale x 4 x half>, <vscale x 4 x half> } %res
+;
+  %res = call { <vscale x 4 x half>, <vscale x 4 x half> } @llvm.vector.deinterleave2.nxv8f16(<vscale x 8 x half> %v)
+  ret { <vscale x 4 x half>, <vscale x 4 x half> } %res
+}
+
+define { <vscale x 4 x i32>, <vscale x 4 x i32> } @deinterleave2_intrinsic_nxv8i32(<vscale x 8 x i32> %v) {
+; NOZVZIP-LABEL: 'deinterleave2_intrinsic_nxv8i32'
+; NOZVZIP-NEXT:  Cost Model: Invalid cost for instruction: %res = call { <vscale x 4 x i32>, <vscale x 4 x i32> } @llvm.vector.deinterleave2.nxv8i32(<vscale x 8 x i32> %v)
+; NOZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret { <vscale x 4 x i32>, <vscale x 4 x i32> } %res
+;
+; ZVZIP-LABEL: 'deinterleave2_intrinsic_nxv8i32'
+; ZVZIP-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %res = call { <vscale x 4 x i32>, <vscale x 4 x i32> } @llvm.vector.deinterleave2.nxv8i32(<vscale x 8 x i32> %v)
+; ZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret { <vscale x 4 x i32>, <vscale x 4 x i32> } %res
+;
+  %res = call { <vscale x 4 x i32>, <vscale x 4 x i32> } @llvm.vector.deinterleave2.nxv8i32(<vscale x 8 x i32> %v)
+  ret { <vscale x 4 x i32>, <vscale x 4 x i32> } %res
+}
+
+define { <vscale x 4 x float>, <vscale x 4 x float> } @deinterleave2_intrinsic_nxv8f32(<vscale x 8 x float> %v) {
+; NOZVZIP-LABEL: 'deinterleave2_intrinsic_nxv8f32'
+; NOZVZIP-NEXT:  Cost Model: Invalid cost for instruction: %res = call { <vscale x 4 x float>, <vscale x 4 x float> } @llvm.vector.deinterleave2.nxv8f32(<vscale x 8 x float> %v)
+; NOZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret { <vscale x 4 x float>, <vscale x 4 x float> } %res
+;
+; ZVZIP-LABEL: 'deinterleave2_intrinsic_nxv8f32'
+; ZVZIP-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %res = call { <vscale x 4 x float>, <vscale x 4 x float> } @llvm.vector.deinterleave2.nxv8f32(<vscale x 8 x float> %v)
+; ZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret { <vscale x 4 x float>, <vscale x 4 x float> } %res
+;
+  %res = call { <vscale x 4 x float>, <vscale x 4 x float> } @llvm.vector.deinterleave2.nxv8f32(<vscale x 8 x float> %v)
+  ret { <vscale x 4 x float>, <vscale x 4 x float> } %res
+}
+
+define { <vscale x 8 x i32>, <vscale x 8 x i32> } @deinterleave2_intrinsic_nxv16i32(<vscale x 16 x i32> %v) {
+; NOZVZIP-LABEL: 'deinterleave2_intrinsic_nxv16i32'
+; NOZVZIP-NEXT:  Cost Model: Invalid cost for instruction: %res = call { <vscale x 8 x i32>, <vscale x 8 x i32> } @llvm.vector.deinterleave2.nxv16i32(<vscale x 16 x i32> %v)
+; NOZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret { <vscale x 8 x i32>, <vscale x 8 x i32> } %res
+;
+; ZVZIP-LABEL: 'deinterleave2_intrinsic_nxv16i32'
+; ZVZIP-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %res = call { <vscale x 8 x i32>, <vscale x 8 x i32> } @llvm.vector.deinterleave2.nxv16i32(<vscale x 16 x i32> %v)
+; ZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret { <vscale x 8 x i32>, <vscale x 8 x i32> } %res
+;
+  %res = call { <vscale x 8 x i32>, <vscale x 8 x i32> } @llvm.vector.deinterleave2.nxv16i32(<vscale x 16 x i32> %v)
+  ret { <vscale x 8 x i32>, <vscale x 8 x i32> } %res
+}
+
+define { <vscale x 8 x i64>, <vscale x 8 x i64> } @deinterleave2_intrinsic_nxv16i64(<vscale x 16 x i64> %v) {
+; NOZVZIP-LABEL: 'deinterleave2_intrinsic_nxv16i64'
+; NOZVZIP-NEXT:  Cost Model: Invalid cost for instruction: %res = call { <vscale x 8 x i64>, <vscale x 8 x i64> } @llvm.vector.deinterleave2.nxv16i64(<vscale x 16 x i64> %v)
+; NOZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret { <vscale x 8 x i64>, <vscale x 8 x i64> } %res
+;
+; V-LABEL: 'deinterleave2_intrinsic_nxv16i64'
+; V-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %res = call { <vscale x 8 x i64>, <vscale x 8 x i64> } @llvm.vector.deinterleave2.nxv16i64(<vscale x 16 x i64> %v)
+; V-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret { <vscale x 8 x i64>, <vscale x 8 x i64> } %res
+;
+; ZVE32-LABEL: 'deinterleave2_intrinsic_nxv16i64'
+; ZVE32-NEXT:  Cost Model: Invalid cost for instruction: %res = call { <vscale x 8 x i64>, <vscale x 8 x i64> } @llvm.vector.deinterleave2.nxv16i64(<vscale x 16 x i64> %v)
+; ZVE32-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret { <vscale x 8 x i64>, <vscale x 8 x i64> } %res
+;
+  %res = call { <vscale x 8 x i64>, <vscale x 8 x i64> } @llvm.vector.deinterleave2.nxv16i64(<vscale x 16 x i64> %v)
+  ret { <vscale x 8 x i64>, <vscale x 8 x i64> } %res
+}
+
+define { <vscale x 16 x i32>, <vscale x 16 x i32> } @deinterleave2_intrinsic_nxv32i32(<vscale x 32 x i32> %v) {
+; NOZVZIP-LABEL: 'deinterleave2_intrinsic_nxv32i32'
+; NOZVZIP-NEXT:  Cost Model: Invalid cost for instruction: %res = call { <vscale x 16 x i32>, <vscale x 16 x i32> } @llvm.vector.deinterleave2.nxv32i32(<vscale x 32 x i32> %v)
+; NOZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret { <vscale x 16 x i32>, <vscale x 16 x i32> } %res
+;
+; ZVZIP-LABEL: 'deinterleave2_intrinsic_nxv32i32'
+; ZVZIP-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %res = call { <vscale x 16 x i32>, <vscale x 16 x i32> } @llvm.vector.deinterleave2.nxv32i32(<vscale x 32 x i32> %v)
+; ZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret { <vscale x 16 x i32>, <vscale x 16 x i32> } %res
+;
+  %res = call { <vscale x 16 x i32>, <vscale x 16 x i32> } @llvm.vector.deinterleave2.nxv32i32(<vscale x 32 x i32> %v)
+  ret { <vscale x 16 x i32>, <vscale x 16 x i32> } %res
+}
+
+define { <vscale x 32 x i32>, <vscale x 32 x i32> } @deinterleave2_intrinsic_nxv64i32(<vscale x 64 x i32> %v) {
+; NOZVZIP-LABEL: 'deinterleave2_intrinsic_nxv64i32'
+; NOZVZIP-NEXT:  Cost Model: Invalid cost for instruction: %res = call { <vscale x 32 x i32>, <vscale x 32 x i32> } @llvm.vector.deinterleave2.nxv64i32(<vscale x 64 x i32> %v)
+; NOZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret { <vscale x 32 x i32>, <vscale x 32 x i32> } %res
+;
+; ZVZIP-LABEL: 'deinterleave2_intrinsic_nxv64i32'
+; ZVZIP-NEXT:  Cost Model: Found an estimated cost of 64 for instruction: %res = call { <vscale x 32 x i32>, <vscale x 32 x i32> } @llvm.vector.deinterleave2.nxv64i32(<vscale x 64 x i32> %v)
+; ZVZIP-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret { <vscale x 32 x i32>, <vscale x 32 x i32> } %res
+;
+  %res = call { <vscale x 32 x i32>, <vscale x 32 x i32> } @llvm.vector.deinterleave2.nxv64i32(<vscale x 64 x i32> %v)
+  ret { <vscale x 32 x i32>, <vscale x 32 x i32> } %res
+}


        


More information about the llvm-commits mailing list