[llvm] [RISCV][TTI] Discount slide cost if ri.vinsert/ri.vextract are available (PR #142036)
Philip Reames via llvm-commits
llvm-commits at lists.llvm.org
Thu May 29 14:04:14 PDT 2025
https://github.com/preames created https://github.com/llvm/llvm-project/pull/142036
If we have the ri.vinsert/vextract instructions from xrivosvisni, we can do an element insert or extract without needing a vslide or a vector temporary register. Adjust the TTI cost to reflect this.
>From 4193b9ab25cf213b51cb0526524dd912eeae5267 Mon Sep 17 00:00:00 2001
From: Philip Reames <preames at rivosinc.com>
Date: Thu, 29 May 2025 13:35:22 -0700
Subject: [PATCH] [RISCV][TTI] Discount slide cost if ri.vinsert/ri.vextract
are available
If we have the ri.vinsert/vextract instructions from xrivosvisni, we can
do an element insert or extract without needing a vslide or a vector
temporary register. Adjust the TTI cost to reflect this.
---
.../Target/RISCV/RISCVTargetTransformInfo.cpp | 5 +-
.../CostModel/RISCV/rvv-extractelement.ll | 298 ++++++++++++++++++
.../CostModel/RISCV/rvv-insertelement.ll | 296 +++++++++++++++++
3 files changed, 598 insertions(+), 1 deletion(-)
diff --git a/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp b/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
index 860d787111ce4..ff822dec232a9 100644
--- a/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
+++ b/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
@@ -2297,9 +2297,12 @@ InstructionCost RISCVTTIImpl::getVectorInstrCost(unsigned Opcode, Type *Val,
Index = Index % M1Max;
}
- // We could extract/insert the first element without vslidedown/vslideup.
if (Index == 0)
+ // We can extract/insert the first element without vslidedown/vslideup.
SlideCost = 0;
+ else if (ST->hasVendorXRivosVisni() && isUInt<5>(Index) &&
+ Val->getScalarType()->isIntegerTy())
+ SlideCost = 0; // With ri.vinsert/ri.vextract there is no slide needed
else if (Opcode == Instruction::InsertElement)
SlideCost = 1; // With a constant index, we do not need to use addi.
}
diff --git a/llvm/test/Analysis/CostModel/RISCV/rvv-extractelement.ll b/llvm/test/Analysis/CostModel/RISCV/rvv-extractelement.ll
index 2859d9fa15168..bca1624d279e7 100644
--- a/llvm/test/Analysis/CostModel/RISCV/rvv-extractelement.ll
+++ b/llvm/test/Analysis/CostModel/RISCV/rvv-extractelement.ll
@@ -1,6 +1,7 @@
; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -mtriple=riscv32 -mattr=+v,+f,+d,+zfh,+zvfh < %s | FileCheck %s --check-prefixes=RV32V
; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -mtriple=riscv64 -mattr=+v,+f,+d,+zfh,+zvfh < %s | FileCheck %s --check-prefixes=RV64V
+; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -mtriple=riscv64 -mattr=+v,+f,+d,+zfh,+zvfh,+experimental-xrivosvisni < %s | FileCheck %s --check-prefixes=VISNI
; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -mtriple=riscv32 -mattr=+zve64x < %s | FileCheck %s --check-prefixes=RV32ZVE64X
; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -mtriple=riscv64 -mattr=+zve64x < %s | FileCheck %s --check-prefixes=RV64ZVE64X
; Check that we don't crash querying costs when vectors are not enabled.
@@ -337,6 +338,171 @@ define void @extractelement_int(i32 %x) {
; RV64V-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %nxv16i64_x = extractelement <vscale x 16 x i64> undef, i32 %x
; RV64V-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
+; VISNI-LABEL: 'extractelement_int'
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v2i1_0 = extractelement <2 x i1> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v4i1_0 = extractelement <4 x i1> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v8i1_0 = extractelement <8 x i1> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v16i1_0 = extractelement <16 x i1> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %v32i1_0 = extractelement <32 x i1> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %nxv2i1_0 = extractelement <vscale x 2 x i1> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %nxv4i1_0 = extractelement <vscale x 4 x i1> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %nxv8i1_0 = extractelement <vscale x 8 x i1> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %nxv16i1_0 = extractelement <vscale x 16 x i1> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %nxv32i1_0 = extractelement <vscale x 32 x i1> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v2i8_0 = extractelement <2 x i8> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v4i8_0 = extractelement <4 x i8> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v8i8_0 = extractelement <8 x i8> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v16i8_0 = extractelement <16 x i8> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v32i8_0 = extractelement <32 x i8> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v64i8_0 = extractelement <64 x i8> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v128i8_0 = extractelement <128 x i8> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv2i8_0 = extractelement <vscale x 2 x i8> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv4i8_0 = extractelement <vscale x 4 x i8> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv8i8_0 = extractelement <vscale x 8 x i8> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv16i8_0 = extractelement <vscale x 16 x i8> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv32i8_0 = extractelement <vscale x 32 x i8> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv64i8_0 = extractelement <vscale x 64 x i8> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv128i8_0 = extractelement <vscale x 128 x i8> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v2i16_0 = extractelement <2 x i16> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v4i16_0 = extractelement <4 x i16> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v8i16_0 = extractelement <8 x i16> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v16i16_0 = extractelement <16 x i16> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v32i16_0 = extractelement <32 x i16> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v64i16_0 = extractelement <64 x i16> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv2i16_0 = extractelement <vscale x 2 x i16> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv4i16_0 = extractelement <vscale x 4 x i16> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv8i16_0 = extractelement <vscale x 8 x i16> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv16i16_0 = extractelement <vscale x 16 x i16> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv32i16_0 = extractelement <vscale x 32 x i16> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv64i16_0 = extractelement <vscale x 64 x i16> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v2i32_0 = extractelement <2 x i32> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v4i32_0 = extractelement <4 x i32> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v8i32_0 = extractelement <8 x i32> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v16i32_0 = extractelement <16 x i32> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v32i32_0 = extractelement <32 x i32> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv2i32_0 = extractelement <vscale x 2 x i32> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv4i32_0 = extractelement <vscale x 4 x i32> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv8i32_0 = extractelement <vscale x 8 x i32> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv16i32_0 = extractelement <vscale x 16 x i32> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv32i32_0 = extractelement <vscale x 32 x i32> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v2i64_0 = extractelement <2 x i64> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v4i64_0 = extractelement <4 x i64> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v8i64_0 = extractelement <8 x i64> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v16i64_0 = extractelement <16 x i64> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv2i64_0 = extractelement <vscale x 2 x i64> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv4i64_0 = extractelement <vscale x 4 x i64> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv8i64_0 = extractelement <vscale x 8 x i64> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv16i64_0 = extractelement <vscale x 16 x i64> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v2i1_1 = extractelement <2 x i1> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v4i1_1 = extractelement <4 x i1> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v8i1_1 = extractelement <8 x i1> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v16i1_1 = extractelement <16 x i1> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %v32i1_1 = extractelement <32 x i1> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %nxv2i1_1 = extractelement <vscale x 2 x i1> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %nxv4i1_1 = extractelement <vscale x 4 x i1> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %nxv8i1_1 = extractelement <vscale x 8 x i1> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %nxv16i1_1 = extractelement <vscale x 16 x i1> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %nxv32i1_1 = extractelement <vscale x 32 x i1> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v2i8_1 = extractelement <2 x i8> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v4i8_1 = extractelement <4 x i8> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v8i8_1 = extractelement <8 x i8> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v16i8_1 = extractelement <16 x i8> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v32i8_1 = extractelement <32 x i8> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v64i8_1 = extractelement <64 x i8> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v128i8_1 = extractelement <128 x i8> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv2i8_1 = extractelement <vscale x 2 x i8> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv4i8_1 = extractelement <vscale x 4 x i8> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv8i8_1 = extractelement <vscale x 8 x i8> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv16i8_1 = extractelement <vscale x 16 x i8> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv32i8_1 = extractelement <vscale x 32 x i8> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv64i8_1 = extractelement <vscale x 64 x i8> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv128i8_1 = extractelement <vscale x 128 x i8> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v2i16_1 = extractelement <2 x i16> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v4i16_1 = extractelement <4 x i16> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v8i16_1 = extractelement <8 x i16> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v16i16_1 = extractelement <16 x i16> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v32i16_1 = extractelement <32 x i16> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v64i16_1 = extractelement <64 x i16> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv2i16_1 = extractelement <vscale x 2 x i16> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv4i16_1 = extractelement <vscale x 4 x i16> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv8i16_1 = extractelement <vscale x 8 x i16> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv16i16_1 = extractelement <vscale x 16 x i16> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv32i16_1 = extractelement <vscale x 32 x i16> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv64i16_1 = extractelement <vscale x 64 x i16> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v2i32_1 = extractelement <2 x i32> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v4i32_1 = extractelement <4 x i32> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v8i32_1 = extractelement <8 x i32> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v16i32_1 = extractelement <16 x i32> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v32i32_1 = extractelement <32 x i32> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv2i32_1 = extractelement <vscale x 2 x i32> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv4i32_1 = extractelement <vscale x 4 x i32> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv8i32_1 = extractelement <vscale x 8 x i32> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv16i32_1 = extractelement <vscale x 16 x i32> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv32i32_1 = extractelement <vscale x 32 x i32> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v2i64_1 = extractelement <2 x i64> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v4i64_1 = extractelement <4 x i64> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v8i64_1 = extractelement <8 x i64> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v16i64_1 = extractelement <16 x i64> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv2i64_1 = extractelement <vscale x 2 x i64> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv4i64_1 = extractelement <vscale x 4 x i64> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv8i64_1 = extractelement <vscale x 8 x i64> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv16i64_1 = extractelement <vscale x 16 x i64> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v2i1_x = extractelement <2 x i1> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v4i1_x = extractelement <4 x i1> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v8i1_x = extractelement <8 x i1> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v16i1_x = extractelement <16 x i1> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %v32i1_x = extractelement <32 x i1> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %nxv2i1_x = extractelement <vscale x 2 x i1> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %nxv4i1_x = extractelement <vscale x 4 x i1> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %nxv8i1_x = extractelement <vscale x 8 x i1> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %nxv16i1_x = extractelement <vscale x 16 x i1> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %nxv32i1_x = extractelement <vscale x 32 x i1> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v2i8_x = extractelement <2 x i8> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v4i8_x = extractelement <4 x i8> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v8i8_x = extractelement <8 x i8> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v16i8_x = extractelement <16 x i8> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v32i8_x = extractelement <32 x i8> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v64i8_x = extractelement <64 x i8> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v128i8_x = extractelement <128 x i8> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv2i8_x = extractelement <vscale x 2 x i8> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv4i8_x = extractelement <vscale x 4 x i8> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv8i8_x = extractelement <vscale x 8 x i8> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv16i8_x = extractelement <vscale x 16 x i8> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv32i8_x = extractelement <vscale x 32 x i8> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv64i8_x = extractelement <vscale x 64 x i8> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %nxv128i8_x = extractelement <vscale x 128 x i8> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v2i16_x = extractelement <2 x i16> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v4i16_x = extractelement <4 x i16> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v8i16_x = extractelement <8 x i16> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v16i16_x = extractelement <16 x i16> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v32i16_x = extractelement <32 x i16> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v64i16_x = extractelement <64 x i16> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv2i16_x = extractelement <vscale x 2 x i16> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv4i16_x = extractelement <vscale x 4 x i16> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv8i16_x = extractelement <vscale x 8 x i16> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv16i16_x = extractelement <vscale x 16 x i16> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv32i16_x = extractelement <vscale x 32 x i16> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %nxv64i16_x = extractelement <vscale x 64 x i16> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v2i32_x = extractelement <2 x i32> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v4i32_x = extractelement <4 x i32> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v8i32_x = extractelement <8 x i32> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v16i32_x = extractelement <16 x i32> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v32i32_x = extractelement <32 x i32> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv2i32_x = extractelement <vscale x 2 x i32> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv4i32_x = extractelement <vscale x 4 x i32> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv8i32_x = extractelement <vscale x 8 x i32> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv16i32_x = extractelement <vscale x 16 x i32> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %nxv32i32_x = extractelement <vscale x 32 x i32> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v2i64_x = extractelement <2 x i64> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v4i64_x = extractelement <4 x i64> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v8i64_x = extractelement <8 x i64> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v16i64_x = extractelement <16 x i64> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv2i64_x = extractelement <vscale x 2 x i64> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv4i64_x = extractelement <vscale x 4 x i64> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv8i64_x = extractelement <vscale x 8 x i64> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %nxv16i64_x = extractelement <vscale x 16 x i64> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
+;
; RV32ZVE64X-LABEL: 'extractelement_int'
; RV32ZVE64X-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v2i1_0 = extractelement <2 x i1> undef, i32 0
; RV32ZVE64X-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v4i1_0 = extractelement <4 x i1> undef, i32 0
@@ -898,6 +1064,23 @@ define void @extractelement_int_lmul(i32 %x) {
; RV64V-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %v64i32 = extractelement <64 x i32> undef, i32 %x
; RV64V-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
+; VISNI-LABEL: 'extractelement_int_lmul'
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v128i8_31 = extractelement <128 x i8> undef, i32 31
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v128i8_63 = extractelement <128 x i8> undef, i32 63
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v128i8_127 = extractelement <128 x i8> undef, i32 127
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v256i8_127 = extractelement <256 x i8> undef, i32 127
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v256i8_255 = extractelement <256 x i8> undef, i32 255
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v32i32_3 = extractelement <32 x i32> undef, i32 3
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v32i32_7 = extractelement <32 x i32> undef, i32 7
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v32i32_15 = extractelement <32 x i32> undef, i32 15
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v32i32_31 = extractelement <32 x i32> undef, i32 31
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v64i32_63 = extractelement <64 x i32> undef, i32 63
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v128i8 = extractelement <128 x i8> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %v256i8 = extractelement <256 x i8> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v32i32 = extractelement <32 x i32> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %v64i32 = extractelement <64 x i32> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
+;
; RV32ZVE64X-LABEL: 'extractelement_int_lmul'
; RV32ZVE64X-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v128i8_31 = extractelement <128 x i8> undef, i32 31
; RV32ZVE64X-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v128i8_63 = extractelement <128 x i8> undef, i32 63
@@ -1141,6 +1324,99 @@ define void @extractelement_fp(i32 %x) {
; RV64V-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %nxv16f64_x = extractelement <vscale x 16 x double> undef, i32 %x
; RV64V-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
+; VISNI-LABEL: 'extractelement_fp'
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v2f16_0 = extractelement <2 x half> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v4f16_0 = extractelement <4 x half> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v8f16_0 = extractelement <8 x half> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v16f16_0 = extractelement <16 x half> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v32f16_0 = extractelement <32 x half> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v64f16_0 = extractelement <64 x half> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv2f16_0 = extractelement <vscale x 2 x half> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv4f16_0 = extractelement <vscale x 4 x half> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv8f16_0 = extractelement <vscale x 8 x half> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv16f16_0 = extractelement <vscale x 16 x half> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv32f16_0 = extractelement <vscale x 32 x half> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv64f16_0 = extractelement <vscale x 64 x half> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v2f32_0 = extractelement <2 x float> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v4f32_0 = extractelement <4 x float> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v8f32_0 = extractelement <8 x float> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v16f32_0 = extractelement <16 x float> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v32f32_0 = extractelement <32 x float> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv2f32_0 = extractelement <vscale x 2 x float> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv4f32_0 = extractelement <vscale x 4 x float> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv8f32_0 = extractelement <vscale x 8 x float> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv16f32_0 = extractelement <vscale x 16 x float> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv32f32_0 = extractelement <vscale x 32 x float> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v2f64_0 = extractelement <2 x double> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v4f64_0 = extractelement <4 x double> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v8f64_0 = extractelement <8 x double> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v16f64_0 = extractelement <16 x double> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv2f64_0 = extractelement <vscale x 2 x double> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv4f64_0 = extractelement <vscale x 4 x double> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv8f64_0 = extractelement <vscale x 8 x double> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv16f64_0 = extractelement <vscale x 16 x double> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v2f16_1 = extractelement <2 x half> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v4f16_1 = extractelement <4 x half> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v8f16_1 = extractelement <8 x half> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v16f16_1 = extractelement <16 x half> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v32f16_1 = extractelement <32 x half> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v64f16_1 = extractelement <64 x half> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv2f16_1 = extractelement <vscale x 2 x half> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv4f16_1 = extractelement <vscale x 4 x half> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv8f16_1 = extractelement <vscale x 8 x half> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv16f16_1 = extractelement <vscale x 16 x half> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv32f16_1 = extractelement <vscale x 32 x half> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv64f16_1 = extractelement <vscale x 64 x half> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v2f32_1 = extractelement <2 x float> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v4f32_1 = extractelement <4 x float> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v8f32_1 = extractelement <8 x float> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v16f32_1 = extractelement <16 x float> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v32f32_1 = extractelement <32 x float> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv2f32_1 = extractelement <vscale x 2 x float> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv4f32_1 = extractelement <vscale x 4 x float> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv8f32_1 = extractelement <vscale x 8 x float> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv16f32_1 = extractelement <vscale x 16 x float> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv32f32_1 = extractelement <vscale x 32 x float> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v2f64_1 = extractelement <2 x double> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v4f64_1 = extractelement <4 x double> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v8f64_1 = extractelement <8 x double> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v16f64_1 = extractelement <16 x double> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv2f64_1 = extractelement <vscale x 2 x double> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv4f64_1 = extractelement <vscale x 4 x double> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv8f64_1 = extractelement <vscale x 8 x double> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv16f64_1 = extractelement <vscale x 16 x double> undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v2f16_x = extractelement <2 x half> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v4f16_x = extractelement <4 x half> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v8f16_x = extractelement <8 x half> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v16f16_x = extractelement <16 x half> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v32f16_x = extractelement <32 x half> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v64f16_x = extractelement <64 x half> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv2f16_x = extractelement <vscale x 2 x half> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv4f16_x = extractelement <vscale x 4 x half> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv8f16_x = extractelement <vscale x 8 x half> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv16f16_x = extractelement <vscale x 16 x half> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv32f16_x = extractelement <vscale x 32 x half> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %nxv64f16_x = extractelement <vscale x 64 x half> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v2f32_x = extractelement <2 x float> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v4f32_x = extractelement <4 x float> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v8f32_x = extractelement <8 x float> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v16f32_x = extractelement <16 x float> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v32f32_x = extractelement <32 x float> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv2f32_x = extractelement <vscale x 2 x float> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv4f32_x = extractelement <vscale x 4 x float> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv8f32_x = extractelement <vscale x 8 x float> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv16f32_x = extractelement <vscale x 16 x float> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %nxv32f32_x = extractelement <vscale x 32 x float> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v2f64_x = extractelement <2 x double> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v4f64_x = extractelement <4 x double> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v8f64_x = extractelement <8 x double> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v16f64_x = extractelement <16 x double> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv2f64_x = extractelement <vscale x 2 x double> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv4f64_x = extractelement <vscale x 4 x double> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv8f64_x = extractelement <vscale x 8 x double> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %nxv16f64_x = extractelement <vscale x 16 x double> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
+;
; RV32ZVE64X-LABEL: 'extractelement_fp'
; RV32ZVE64X-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %v2f16_0 = extractelement <2 x half> undef, i32 0
; RV32ZVE64X-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %v4f16_0 = extractelement <4 x half> undef, i32 0
@@ -1464,6 +1740,18 @@ define void @extractelement_int_nonpoweroftwo(i32 %x) {
; RV64V-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v31i32_0 = extractelement <31 x i32> undef, i32 0
; RV64V-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
+; VISNI-LABEL: 'extractelement_int_nonpoweroftwo'
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v3i8 = extractelement <3 x i8> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v7i8 = extractelement <7 x i8> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v15i8 = extractelement <15 x i8> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v31i8 = extractelement <31 x i8> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v3i32 = extractelement <3 x i32> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v7i32 = extractelement <7 x i32> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v15i32 = extractelement <15 x i32> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v31i32 = extractelement <31 x i32> undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v31i32_0 = extractelement <31 x i32> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
+;
; RV32ZVE64X-LABEL: 'extractelement_int_nonpoweroftwo'
; RV32ZVE64X-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v3i8 = extractelement <3 x i8> undef, i32 %x
; RV32ZVE64X-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v7i8 = extractelement <7 x i8> undef, i32 %x
@@ -1523,6 +1811,16 @@ define void @extractelement_vls(i32 %x) vscale_range(2,2) {
; RV64V-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v32i32_12 = extractelement <32 x i32> undef, i32 12
; RV64V-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
+; VISNI-LABEL: 'extractelement_vls'
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v32i32_0 = extractelement <32 x i32> undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v32i32_4 = extractelement <32 x i32> undef, i32 4
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v32i32_5 = extractelement <32 x i32> undef, i32 5
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v32i32_8 = extractelement <32 x i32> undef, i32 8
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v32i32_9 = extractelement <32 x i32> undef, i32 9
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v32i32_11 = extractelement <32 x i32> undef, i32 11
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v32i32_12 = extractelement <32 x i32> undef, i32 12
+; VISNI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
+;
; RV32ZVE64X-LABEL: 'extractelement_vls'
; RV32ZVE64X-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v32i32_0 = extractelement <32 x i32> undef, i32 0
; RV32ZVE64X-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v32i32_4 = extractelement <32 x i32> undef, i32 4
diff --git a/llvm/test/Analysis/CostModel/RISCV/rvv-insertelement.ll b/llvm/test/Analysis/CostModel/RISCV/rvv-insertelement.ll
index 586498e196af0..39b7e01f69412 100644
--- a/llvm/test/Analysis/CostModel/RISCV/rvv-insertelement.ll
+++ b/llvm/test/Analysis/CostModel/RISCV/rvv-insertelement.ll
@@ -1,6 +1,7 @@
; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -mtriple=riscv32 -mattr=+v,+f,+d,+zfh,+zvfh < %s | FileCheck %s --check-prefixes=RV32V
; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -mtriple=riscv64 -mattr=+v,+f,+d,+zfh,+zvfh < %s | FileCheck %s --check-prefixes=RV64V
+; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -mtriple=riscv64 -mattr=+v,+f,+d,+zfh,+zvfh,+experimental-xrivosvisni < %s | FileCheck %s --check-prefixes=VISNI
; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -mtriple=riscv32 -mattr=+zve64x < %s | FileCheck %s --check-prefixes=RV32ZVE64X
; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -mtriple=riscv64 -mattr=+zve64x < %s | FileCheck %s --check-prefixes=RV64ZVE64X
; Check that we don't crash querying costs when vectors are not enabled.
@@ -337,6 +338,171 @@ define void @insertelement_int(i32 %x) {
; RV64V-NEXT: Cost Model: Found an estimated cost of 34 for instruction: %nxv16i64_x = insertelement <vscale x 16 x i64> undef, i64 undef, i32 %x
; RV64V-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
+; VISNI-LABEL: 'insertelement_int'
+; VISNI-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %v2i1_0 = insertelement <2 x i1> undef, i1 undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %v4i1_0 = insertelement <4 x i1> undef, i1 undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %v8i1_0 = insertelement <8 x i1> undef, i1 undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %v16i1_0 = insertelement <16 x i1> undef, i1 undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %v32i1_0 = insertelement <32 x i1> undef, i1 undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %nxv2i1_0 = insertelement <vscale x 2 x i1> undef, i1 undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %nxv4i1_0 = insertelement <vscale x 4 x i1> undef, i1 undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %nxv8i1_0 = insertelement <vscale x 8 x i1> undef, i1 undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %nxv16i1_0 = insertelement <vscale x 16 x i1> undef, i1 undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %nxv32i1_0 = insertelement <vscale x 32 x i1> undef, i1 undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v2i8_0 = insertelement <2 x i8> undef, i8 undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v4i8_0 = insertelement <4 x i8> undef, i8 undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v8i8_0 = insertelement <8 x i8> undef, i8 undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v16i8_0 = insertelement <16 x i8> undef, i8 undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v32i8_0 = insertelement <32 x i8> undef, i8 undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v64i8_0 = insertelement <64 x i8> undef, i8 undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v128i8_0 = insertelement <128 x i8> undef, i8 undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv2i8_0 = insertelement <vscale x 2 x i8> undef, i8 undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv4i8_0 = insertelement <vscale x 4 x i8> undef, i8 undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv8i8_0 = insertelement <vscale x 8 x i8> undef, i8 undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv16i8_0 = insertelement <vscale x 16 x i8> undef, i8 undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv32i8_0 = insertelement <vscale x 32 x i8> undef, i8 undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv64i8_0 = insertelement <vscale x 64 x i8> undef, i8 undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv128i8_0 = insertelement <vscale x 128 x i8> undef, i8 undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v2i16_0 = insertelement <2 x i16> undef, i16 undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v4i16_0 = insertelement <4 x i16> undef, i16 undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v8i16_0 = insertelement <8 x i16> undef, i16 undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v16i16_0 = insertelement <16 x i16> undef, i16 undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v32i16_0 = insertelement <32 x i16> undef, i16 undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v64i16_0 = insertelement <64 x i16> undef, i16 undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv2i16_0 = insertelement <vscale x 2 x i16> undef, i16 undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv4i16_0 = insertelement <vscale x 4 x i16> undef, i16 undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv8i16_0 = insertelement <vscale x 8 x i16> undef, i16 undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv16i16_0 = insertelement <vscale x 16 x i16> undef, i16 undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv32i16_0 = insertelement <vscale x 32 x i16> undef, i16 undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv64i16_0 = insertelement <vscale x 64 x i16> undef, i16 undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v2i32_0 = insertelement <2 x i32> undef, i32 undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v4i32_0 = insertelement <4 x i32> undef, i32 undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v8i32_0 = insertelement <8 x i32> undef, i32 undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v16i32_0 = insertelement <16 x i32> undef, i32 undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v32i32_0 = insertelement <32 x i32> undef, i32 undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv2i32_0 = insertelement <vscale x 2 x i32> undef, i32 undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv4i32_0 = insertelement <vscale x 4 x i32> undef, i32 undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv8i32_0 = insertelement <vscale x 8 x i32> undef, i32 undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv16i32_0 = insertelement <vscale x 16 x i32> undef, i32 undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv32i32_0 = insertelement <vscale x 32 x i32> undef, i32 undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v2i64_0 = insertelement <2 x i64> undef, i64 undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v4i64_0 = insertelement <4 x i64> undef, i64 undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v8i64_0 = insertelement <8 x i64> undef, i64 undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v16i64_0 = insertelement <16 x i64> undef, i64 undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv2i64_0 = insertelement <vscale x 2 x i64> undef, i64 undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv4i64_0 = insertelement <vscale x 4 x i64> undef, i64 undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv8i64_0 = insertelement <vscale x 8 x i64> undef, i64 undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv16i64_0 = insertelement <vscale x 16 x i64> undef, i64 undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %v2i1_1 = insertelement <2 x i1> undef, i1 undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %v4i1_1 = insertelement <4 x i1> undef, i1 undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %v8i1_1 = insertelement <8 x i1> undef, i1 undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %v16i1_1 = insertelement <16 x i1> undef, i1 undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %v32i1_1 = insertelement <32 x i1> undef, i1 undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %nxv2i1_1 = insertelement <vscale x 2 x i1> undef, i1 undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %nxv4i1_1 = insertelement <vscale x 4 x i1> undef, i1 undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %nxv8i1_1 = insertelement <vscale x 8 x i1> undef, i1 undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %nxv16i1_1 = insertelement <vscale x 16 x i1> undef, i1 undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %nxv32i1_1 = insertelement <vscale x 32 x i1> undef, i1 undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v2i8_1 = insertelement <2 x i8> undef, i8 undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v4i8_1 = insertelement <4 x i8> undef, i8 undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v8i8_1 = insertelement <8 x i8> undef, i8 undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v16i8_1 = insertelement <16 x i8> undef, i8 undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v32i8_1 = insertelement <32 x i8> undef, i8 undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v64i8_1 = insertelement <64 x i8> undef, i8 undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v128i8_1 = insertelement <128 x i8> undef, i8 undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv2i8_1 = insertelement <vscale x 2 x i8> undef, i8 undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv4i8_1 = insertelement <vscale x 4 x i8> undef, i8 undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv8i8_1 = insertelement <vscale x 8 x i8> undef, i8 undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv16i8_1 = insertelement <vscale x 16 x i8> undef, i8 undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv32i8_1 = insertelement <vscale x 32 x i8> undef, i8 undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv64i8_1 = insertelement <vscale x 64 x i8> undef, i8 undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv128i8_1 = insertelement <vscale x 128 x i8> undef, i8 undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v2i16_1 = insertelement <2 x i16> undef, i16 undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v4i16_1 = insertelement <4 x i16> undef, i16 undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v8i16_1 = insertelement <8 x i16> undef, i16 undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v16i16_1 = insertelement <16 x i16> undef, i16 undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v32i16_1 = insertelement <32 x i16> undef, i16 undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v64i16_1 = insertelement <64 x i16> undef, i16 undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv2i16_1 = insertelement <vscale x 2 x i16> undef, i16 undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv4i16_1 = insertelement <vscale x 4 x i16> undef, i16 undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv8i16_1 = insertelement <vscale x 8 x i16> undef, i16 undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv16i16_1 = insertelement <vscale x 16 x i16> undef, i16 undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv32i16_1 = insertelement <vscale x 32 x i16> undef, i16 undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv64i16_1 = insertelement <vscale x 64 x i16> undef, i16 undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v2i32_1 = insertelement <2 x i32> undef, i32 undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v4i32_1 = insertelement <4 x i32> undef, i32 undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v8i32_1 = insertelement <8 x i32> undef, i32 undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v16i32_1 = insertelement <16 x i32> undef, i32 undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v32i32_1 = insertelement <32 x i32> undef, i32 undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv2i32_1 = insertelement <vscale x 2 x i32> undef, i32 undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv4i32_1 = insertelement <vscale x 4 x i32> undef, i32 undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv8i32_1 = insertelement <vscale x 8 x i32> undef, i32 undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv16i32_1 = insertelement <vscale x 16 x i32> undef, i32 undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv32i32_1 = insertelement <vscale x 32 x i32> undef, i32 undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v2i64_1 = insertelement <2 x i64> undef, i64 undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v4i64_1 = insertelement <4 x i64> undef, i64 undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v8i64_1 = insertelement <8 x i64> undef, i64 undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v16i64_1 = insertelement <16 x i64> undef, i64 undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv2i64_1 = insertelement <vscale x 2 x i64> undef, i64 undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv4i64_1 = insertelement <vscale x 4 x i64> undef, i64 undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv8i64_1 = insertelement <vscale x 8 x i64> undef, i64 undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv16i64_1 = insertelement <vscale x 16 x i64> undef, i64 undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %v2i1_x = insertelement <2 x i1> undef, i1 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %v4i1_x = insertelement <4 x i1> undef, i1 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %v8i1_x = insertelement <8 x i1> undef, i1 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %v16i1_x = insertelement <16 x i1> undef, i1 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %v32i1_x = insertelement <32 x i1> undef, i1 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %nxv2i1_x = insertelement <vscale x 2 x i1> undef, i1 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %nxv4i1_x = insertelement <vscale x 4 x i1> undef, i1 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %nxv8i1_x = insertelement <vscale x 8 x i1> undef, i1 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %nxv16i1_x = insertelement <vscale x 16 x i1> undef, i1 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 19 for instruction: %nxv32i1_x = insertelement <vscale x 32 x i1> undef, i1 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v2i8_x = insertelement <2 x i8> undef, i8 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v4i8_x = insertelement <4 x i8> undef, i8 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v8i8_x = insertelement <8 x i8> undef, i8 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v16i8_x = insertelement <16 x i8> undef, i8 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v32i8_x = insertelement <32 x i8> undef, i8 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v64i8_x = insertelement <64 x i8> undef, i8 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v128i8_x = insertelement <128 x i8> undef, i8 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %nxv2i8_x = insertelement <vscale x 2 x i8> undef, i8 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %nxv4i8_x = insertelement <vscale x 4 x i8> undef, i8 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %nxv8i8_x = insertelement <vscale x 8 x i8> undef, i8 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %nxv16i8_x = insertelement <vscale x 16 x i8> undef, i8 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %nxv32i8_x = insertelement <vscale x 32 x i8> undef, i8 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %nxv64i8_x = insertelement <vscale x 64 x i8> undef, i8 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 34 for instruction: %nxv128i8_x = insertelement <vscale x 128 x i8> undef, i8 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v2i16_x = insertelement <2 x i16> undef, i16 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v4i16_x = insertelement <4 x i16> undef, i16 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v8i16_x = insertelement <8 x i16> undef, i16 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v16i16_x = insertelement <16 x i16> undef, i16 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v32i16_x = insertelement <32 x i16> undef, i16 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v64i16_x = insertelement <64 x i16> undef, i16 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %nxv2i16_x = insertelement <vscale x 2 x i16> undef, i16 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %nxv4i16_x = insertelement <vscale x 4 x i16> undef, i16 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %nxv8i16_x = insertelement <vscale x 8 x i16> undef, i16 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %nxv16i16_x = insertelement <vscale x 16 x i16> undef, i16 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %nxv32i16_x = insertelement <vscale x 32 x i16> undef, i16 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 34 for instruction: %nxv64i16_x = insertelement <vscale x 64 x i16> undef, i16 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v2i32_x = insertelement <2 x i32> undef, i32 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v4i32_x = insertelement <4 x i32> undef, i32 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v8i32_x = insertelement <8 x i32> undef, i32 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v16i32_x = insertelement <16 x i32> undef, i32 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v32i32_x = insertelement <32 x i32> undef, i32 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %nxv2i32_x = insertelement <vscale x 2 x i32> undef, i32 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %nxv4i32_x = insertelement <vscale x 4 x i32> undef, i32 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %nxv8i32_x = insertelement <vscale x 8 x i32> undef, i32 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %nxv16i32_x = insertelement <vscale x 16 x i32> undef, i32 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 34 for instruction: %nxv32i32_x = insertelement <vscale x 32 x i32> undef, i32 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v2i64_x = insertelement <2 x i64> undef, i64 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v4i64_x = insertelement <4 x i64> undef, i64 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v8i64_x = insertelement <8 x i64> undef, i64 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v16i64_x = insertelement <16 x i64> undef, i64 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %nxv2i64_x = insertelement <vscale x 2 x i64> undef, i64 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %nxv4i64_x = insertelement <vscale x 4 x i64> undef, i64 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %nxv8i64_x = insertelement <vscale x 8 x i64> undef, i64 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 34 for instruction: %nxv16i64_x = insertelement <vscale x 16 x i64> undef, i64 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
+;
; RV32ZVE64X-LABEL: 'insertelement_int'
; RV32ZVE64X-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %v2i1_0 = insertelement <2 x i1> undef, i1 undef, i32 0
; RV32ZVE64X-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %v4i1_0 = insertelement <4 x i1> undef, i1 undef, i32 0
@@ -898,6 +1064,23 @@ define void @insertelement_int_lmul(i32 %x) {
; RV64V-NEXT: Cost Model: Found an estimated cost of 34 for instruction: %v64i32 = insertelement <64 x i32> undef, i32 undef, i32 %x
; RV64V-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
+; VISNI-LABEL: 'insertelement_int_lmul'
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v128i8_31 = insertelement <128 x i8> undef, i8 undef, i32 31
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v128i8_63 = insertelement <128 x i8> undef, i8 undef, i32 63
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v128i8_127 = insertelement <128 x i8> undef, i8 undef, i32 127
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v256i8_127 = insertelement <256 x i8> undef, i8 undef, i32 127
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v256i8_255 = insertelement <256 x i8> undef, i8 undef, i32 255
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v32i32_3 = insertelement <32 x i32> undef, i32 undef, i32 3
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v32i32_7 = insertelement <32 x i32> undef, i32 undef, i32 7
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v32i32_15 = insertelement <32 x i32> undef, i32 undef, i32 15
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v32i32_31 = insertelement <32 x i32> undef, i32 undef, i32 31
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v64i32_63 = insertelement <64 x i32> undef, i32 undef, i32 63
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v128i8 = insertelement <128 x i8> undef, i8 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 34 for instruction: %v256i8 = insertelement <256 x i8> undef, i8 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v32i32 = insertelement <32 x i32> undef, i32 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 34 for instruction: %v64i32 = insertelement <64 x i32> undef, i32 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
+;
; RV32ZVE64X-LABEL: 'insertelement_int_lmul'
; RV32ZVE64X-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v128i8_31 = insertelement <128 x i8> undef, i8 undef, i32 31
; RV32ZVE64X-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v128i8_63 = insertelement <128 x i8> undef, i8 undef, i32 63
@@ -1141,6 +1324,99 @@ define void @insertelement_fp(i32 %x) {
; RV64V-NEXT: Cost Model: Found an estimated cost of 34 for instruction: %nxv16f64_x = insertelement <vscale x 16 x double> undef, double undef, i32 %x
; RV64V-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
+; VISNI-LABEL: 'insertelement_fp'
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v2f16_0 = insertelement <2 x half> undef, half undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v4f16_0 = insertelement <4 x half> undef, half undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v8f16_0 = insertelement <8 x half> undef, half undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v16f16_0 = insertelement <16 x half> undef, half undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v32f16_0 = insertelement <32 x half> undef, half undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v64f16_0 = insertelement <64 x half> undef, half undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv2f16_0 = insertelement <vscale x 2 x half> undef, half undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv4f16_0 = insertelement <vscale x 4 x half> undef, half undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv8f16_0 = insertelement <vscale x 8 x half> undef, half undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv16f16_0 = insertelement <vscale x 16 x half> undef, half undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv32f16_0 = insertelement <vscale x 32 x half> undef, half undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv64f16_0 = insertelement <vscale x 64 x half> undef, half undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v2f32_0 = insertelement <2 x float> undef, float undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v4f32_0 = insertelement <4 x float> undef, float undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v8f32_0 = insertelement <8 x float> undef, float undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v16f32_0 = insertelement <16 x float> undef, float undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v32f32_0 = insertelement <32 x float> undef, float undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv2f32_0 = insertelement <vscale x 2 x float> undef, float undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv4f32_0 = insertelement <vscale x 4 x float> undef, float undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv8f32_0 = insertelement <vscale x 8 x float> undef, float undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv16f32_0 = insertelement <vscale x 16 x float> undef, float undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv32f32_0 = insertelement <vscale x 32 x float> undef, float undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v2f64_0 = insertelement <2 x double> undef, double undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v4f64_0 = insertelement <4 x double> undef, double undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v8f64_0 = insertelement <8 x double> undef, double undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v16f64_0 = insertelement <16 x double> undef, double undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv2f64_0 = insertelement <vscale x 2 x double> undef, double undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv4f64_0 = insertelement <vscale x 4 x double> undef, double undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv8f64_0 = insertelement <vscale x 8 x double> undef, double undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv16f64_0 = insertelement <vscale x 16 x double> undef, double undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v2f16_1 = insertelement <2 x half> undef, half undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v4f16_1 = insertelement <4 x half> undef, half undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v8f16_1 = insertelement <8 x half> undef, half undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v16f16_1 = insertelement <16 x half> undef, half undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v32f16_1 = insertelement <32 x half> undef, half undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v64f16_1 = insertelement <64 x half> undef, half undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv2f16_1 = insertelement <vscale x 2 x half> undef, half undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv4f16_1 = insertelement <vscale x 4 x half> undef, half undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv8f16_1 = insertelement <vscale x 8 x half> undef, half undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv16f16_1 = insertelement <vscale x 16 x half> undef, half undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv32f16_1 = insertelement <vscale x 32 x half> undef, half undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv64f16_1 = insertelement <vscale x 64 x half> undef, half undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v2f32_1 = insertelement <2 x float> undef, float undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v4f32_1 = insertelement <4 x float> undef, float undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v8f32_1 = insertelement <8 x float> undef, float undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v16f32_1 = insertelement <16 x float> undef, float undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v32f32_1 = insertelement <32 x float> undef, float undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv2f32_1 = insertelement <vscale x 2 x float> undef, float undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv4f32_1 = insertelement <vscale x 4 x float> undef, float undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv8f32_1 = insertelement <vscale x 8 x float> undef, float undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv16f32_1 = insertelement <vscale x 16 x float> undef, float undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv32f32_1 = insertelement <vscale x 32 x float> undef, float undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v2f64_1 = insertelement <2 x double> undef, double undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v4f64_1 = insertelement <4 x double> undef, double undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v8f64_1 = insertelement <8 x double> undef, double undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v16f64_1 = insertelement <16 x double> undef, double undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv2f64_1 = insertelement <vscale x 2 x double> undef, double undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv4f64_1 = insertelement <vscale x 4 x double> undef, double undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv8f64_1 = insertelement <vscale x 8 x double> undef, double undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv16f64_1 = insertelement <vscale x 16 x double> undef, double undef, i32 1
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v2f16_x = insertelement <2 x half> undef, half undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v4f16_x = insertelement <4 x half> undef, half undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v8f16_x = insertelement <8 x half> undef, half undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v16f16_x = insertelement <16 x half> undef, half undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v32f16_x = insertelement <32 x half> undef, half undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v64f16_x = insertelement <64 x half> undef, half undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %nxv2f16_x = insertelement <vscale x 2 x half> undef, half undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %nxv4f16_x = insertelement <vscale x 4 x half> undef, half undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %nxv8f16_x = insertelement <vscale x 8 x half> undef, half undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %nxv16f16_x = insertelement <vscale x 16 x half> undef, half undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %nxv32f16_x = insertelement <vscale x 32 x half> undef, half undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 34 for instruction: %nxv64f16_x = insertelement <vscale x 64 x half> undef, half undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v2f32_x = insertelement <2 x float> undef, float undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v4f32_x = insertelement <4 x float> undef, float undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v8f32_x = insertelement <8 x float> undef, float undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v16f32_x = insertelement <16 x float> undef, float undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v32f32_x = insertelement <32 x float> undef, float undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %nxv2f32_x = insertelement <vscale x 2 x float> undef, float undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %nxv4f32_x = insertelement <vscale x 4 x float> undef, float undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %nxv8f32_x = insertelement <vscale x 8 x float> undef, float undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %nxv16f32_x = insertelement <vscale x 16 x float> undef, float undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 34 for instruction: %nxv32f32_x = insertelement <vscale x 32 x float> undef, float undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v2f64_x = insertelement <2 x double> undef, double undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v4f64_x = insertelement <4 x double> undef, double undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v8f64_x = insertelement <8 x double> undef, double undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v16f64_x = insertelement <16 x double> undef, double undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %nxv2f64_x = insertelement <vscale x 2 x double> undef, double undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %nxv4f64_x = insertelement <vscale x 4 x double> undef, double undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %nxv8f64_x = insertelement <vscale x 8 x double> undef, double undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 34 for instruction: %nxv16f64_x = insertelement <vscale x 16 x double> undef, double undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
+;
; RV32ZVE64X-LABEL: 'insertelement_fp'
; RV32ZVE64X-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %v2f16_0 = insertelement <2 x half> undef, half undef, i32 0
; RV32ZVE64X-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %v4f16_0 = insertelement <4 x half> undef, half undef, i32 0
@@ -1460,6 +1736,16 @@ define void @insertelement_int_nonpoweroftwo(i32 %x) {
; RV64V-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v15i32 = insertelement <15 x i32> undef, i32 undef, i32 %x
; RV64V-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
+; VISNI-LABEL: 'insertelement_int_nonpoweroftwo'
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v3i8 = insertelement <3 x i8> undef, i8 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v7i8 = insertelement <7 x i8> undef, i8 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v15i8 = insertelement <15 x i8> undef, i8 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v3i32_0 = insertelement <3 x i32> undef, i32 undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v3i32 = insertelement <3 x i32> undef, i32 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v7i32 = insertelement <7 x i32> undef, i32 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v15i32 = insertelement <15 x i32> undef, i32 undef, i32 %x
+; VISNI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
+;
; RV32ZVE64X-LABEL: 'insertelement_int_nonpoweroftwo'
; RV32ZVE64X-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v3i8 = insertelement <3 x i8> undef, i8 undef, i32 %x
; RV32ZVE64X-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v7i8 = insertelement <7 x i8> undef, i8 undef, i32 %x
@@ -1513,6 +1799,16 @@ define void @insertelement_vls(i32 %x) vscale_range(2,2) {
; RV64V-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v32i32_12 = insertelement <32 x i32> undef, i32 undef, i32 12
; RV64V-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
+; VISNI-LABEL: 'insertelement_vls'
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v32i32_0 = insertelement <32 x i32> undef, i32 undef, i32 0
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v32i32_4 = insertelement <32 x i32> undef, i32 undef, i32 4
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v32i32_5 = insertelement <32 x i32> undef, i32 undef, i32 5
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v32i32_8 = insertelement <32 x i32> undef, i32 undef, i32 8
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v32i32_9 = insertelement <32 x i32> undef, i32 undef, i32 9
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v32i32_11 = insertelement <32 x i32> undef, i32 undef, i32 11
+; VISNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v32i32_12 = insertelement <32 x i32> undef, i32 undef, i32 12
+; VISNI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
+;
; RV32ZVE64X-LABEL: 'insertelement_vls'
; RV32ZVE64X-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v32i32_0 = insertelement <32 x i32> undef, i32 undef, i32 0
; RV32ZVE64X-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v32i32_4 = insertelement <32 x i32> undef, i32 undef, i32 4
More information about the llvm-commits
mailing list