diff --git a/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp b/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp --- a/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp +++ b/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp @@ -391,6 +391,23 @@ { ISD::TRUNCATE, MVT::v8i8, MVT::v8i32, 3 }, { ISD::TRUNCATE, MVT::v16i8, MVT::v16i32, 6 }, + // Truncations on nxvmiN + { ISD::TRUNCATE, MVT::nxv2i1, MVT::nxv2i16, 1 }, + { ISD::TRUNCATE, MVT::nxv2i1, MVT::nxv2i32, 1 }, + { ISD::TRUNCATE, MVT::nxv2i1, MVT::nxv2i64, 1 }, + { ISD::TRUNCATE, MVT::nxv4i1, MVT::nxv4i16, 1 }, + { ISD::TRUNCATE, MVT::nxv4i1, MVT::nxv4i32, 1 }, + { ISD::TRUNCATE, MVT::nxv4i1, MVT::nxv4i64, 2 }, + { ISD::TRUNCATE, MVT::nxv8i1, MVT::nxv8i16, 1 }, + { ISD::TRUNCATE, MVT::nxv8i1, MVT::nxv8i32, 3 }, + { ISD::TRUNCATE, MVT::nxv8i1, MVT::nxv8i64, 5 }, + { ISD::TRUNCATE, MVT::nxv2i16, MVT::nxv2i32, 1 }, + { ISD::TRUNCATE, MVT::nxv2i32, MVT::nxv2i64, 1 }, + { ISD::TRUNCATE, MVT::nxv4i16, MVT::nxv4i32, 1 }, + { ISD::TRUNCATE, MVT::nxv4i32, MVT::nxv4i64, 2 }, + { ISD::TRUNCATE, MVT::nxv8i16, MVT::nxv8i32, 3 }, + { ISD::TRUNCATE, MVT::nxv8i32, MVT::nxv8i64, 6 }, + // The number of shll instructions for the extension. { ISD::SIGN_EXTEND, MVT::v4i64, MVT::v4i16, 3 }, { ISD::ZERO_EXTEND, MVT::v4i64, MVT::v4i16, 3 }, @@ -472,6 +489,23 @@ { ISD::FP_TO_UINT, MVT::v4i16, MVT::v4f32, 2 }, { ISD::FP_TO_UINT, MVT::v4i8, MVT::v4f32, 2 }, + // Lowering scalable + { ISD::FP_TO_SINT, MVT::nxv2i32, MVT::nxv2f32, 1 }, + { ISD::FP_TO_SINT, MVT::nxv4i32, MVT::nxv4f32, 1 }, + { ISD::FP_TO_SINT, MVT::nxv2i64, MVT::nxv2f64, 1 }, + { ISD::FP_TO_UINT, MVT::nxv2i32, MVT::nxv2f32, 1 }, + { ISD::FP_TO_UINT, MVT::nxv4i32, MVT::nxv4f32, 1 }, + { ISD::FP_TO_UINT, MVT::nxv2i64, MVT::nxv2f64, 1 }, + + + // Complex, from nxv2f32 legal type is nxv2i32 (no cost) or nxv2i64 (1 ext) + { ISD::FP_TO_SINT, MVT::nxv2i64, MVT::nxv2f32, 2 }, + { ISD::FP_TO_SINT, MVT::nxv2i16, MVT::nxv2f32, 1 }, + { ISD::FP_TO_SINT, MVT::nxv2i8, MVT::nxv2f32, 1 }, + { ISD::FP_TO_UINT, MVT::nxv2i64, MVT::nxv2f32, 2 }, + { ISD::FP_TO_UINT, MVT::nxv2i16, MVT::nxv2f32, 1 }, + { ISD::FP_TO_UINT, MVT::nxv2i8, MVT::nxv2f32, 1 }, + // Complex, from v2f64: legal type is v2i32, 1 narrowing => ~2. { ISD::FP_TO_SINT, MVT::v2i32, MVT::v2f64, 2 }, { ISD::FP_TO_SINT, MVT::v2i16, MVT::v2f64, 2 }, @@ -479,6 +513,75 @@ { ISD::FP_TO_UINT, MVT::v2i32, MVT::v2f64, 2 }, { ISD::FP_TO_UINT, MVT::v2i16, MVT::v2f64, 2 }, { ISD::FP_TO_UINT, MVT::v2i8, MVT::v2f64, 2 }, + + // Complex, from nxv2f64: legal type is nxv2i32, 1 narrowing => ~2. + { ISD::FP_TO_SINT, MVT::nxv2i32, MVT::nxv2f64, 2 }, + { ISD::FP_TO_SINT, MVT::nxv2i16, MVT::nxv2f64, 2 }, + { ISD::FP_TO_SINT, MVT::nxv2i8, MVT::nxv2f64, 2 }, + { ISD::FP_TO_UINT, MVT::nxv2i32, MVT::nxv2f64, 2 }, + { ISD::FP_TO_UINT, MVT::nxv2i16, MVT::nxv2f64, 2 }, + { ISD::FP_TO_UINT, MVT::nxv2i8, MVT::nxv2f64, 2 }, + + // Complex, from nxv4f32 legal type is nxv4i16, 1 narrowing => ~2 + { ISD::FP_TO_SINT, MVT::nxv4i16, MVT::nxv4f32, 2 }, + { ISD::FP_TO_SINT, MVT::nxv4i8, MVT::nxv4f32, 2 }, + { ISD::FP_TO_UINT, MVT::nxv4i16, MVT::nxv4f32, 2 }, + { ISD::FP_TO_UINT, MVT::nxv4i8, MVT::nxv4f32, 2 }, + + // Complex, from nxv8f64: legal type is nxv8i32, 1 narrowing => ~2. + { ISD::FP_TO_SINT, MVT::nxv8i32, MVT::nxv8f64, 2 }, + { ISD::FP_TO_SINT, MVT::nxv8i16, MVT::nxv8f64, 2 }, + { ISD::FP_TO_SINT, MVT::nxv8i8, MVT::nxv8f64, 2 }, + { ISD::FP_TO_UINT, MVT::nxv8i32, MVT::nxv8f64, 2 }, + { ISD::FP_TO_UINT, MVT::nxv8i16, MVT::nxv8f64, 2 }, + { ISD::FP_TO_UINT, MVT::nxv8i8, MVT::nxv8f64, 2 }, + + // Complex, from nxv4f64: legal type is nxv4i32, 1 narrowing => ~2. + { ISD::FP_TO_SINT, MVT::nxv4i32, MVT::nxv4f64, 2 }, + { ISD::FP_TO_SINT, MVT::nxv4i16, MVT::nxv4f64, 2 }, + { ISD::FP_TO_SINT, MVT::nxv4i8, MVT::nxv4f64, 2 }, + { ISD::FP_TO_UINT, MVT::nxv4i32, MVT::nxv4f64, 2 }, + { ISD::FP_TO_UINT, MVT::nxv4i16, MVT::nxv4f64, 2 }, + { ISD::FP_TO_UINT, MVT::nxv4i8, MVT::nxv4f64, 2 }, + + // Complex, from nxv8f32: legal type is nxv8i32 (no cost) or nxv8i64 (1 ext). + { ISD::FP_TO_SINT, MVT::nxv8i64, MVT::nxv8f32, 2 }, + { ISD::FP_TO_SINT, MVT::nxv8i16, MVT::nxv8f32, 3 }, + { ISD::FP_TO_SINT, MVT::nxv8i8, MVT::nxv8f32, 1 }, + { ISD::FP_TO_UINT, MVT::nxv8i64, MVT::nxv8f32, 2 }, + { ISD::FP_TO_UINT, MVT::nxv8i16, MVT::nxv8f32, 1 }, + { ISD::FP_TO_UINT, MVT::nxv8i8, MVT::nxv8f32, 1 }, + + // Truncate from nxvmf32 to nxvmf16. + { ISD::FP_ROUND, MVT::nxv2f16, MVT::nxv2f32, 1 }, + { ISD::FP_ROUND, MVT::nxv4f16, MVT::nxv4f32, 1 }, + { ISD::FP_ROUND, MVT::nxv8f16, MVT::nxv8f32, 3 }, + + // Truncate from nxvmf64 to nxvmf16. + { ISD::FP_ROUND, MVT::nxv2f16, MVT::nxv2f64, 1 }, + { ISD::FP_ROUND, MVT::nxv4f16, MVT::nxv4f64, 3 }, + { ISD::FP_ROUND, MVT::nxv8f16, MVT::nxv8f64, 7 }, + + // Truncate from nxvmf64 to nxvmf32. + { ISD::FP_ROUND, MVT::nxv2f32, MVT::nxv2f64, 1 }, + { ISD::FP_ROUND, MVT::nxv4f32, MVT::nxv4f64, 3 }, + { ISD::FP_ROUND, MVT::nxv8f32, MVT::nxv8f64, 6 }, + + // Extend from nxvmf16 to nxvmf32. + { ISD::FP_EXTEND, MVT::nxv2f32, MVT::nxv2f16, 1}, + { ISD::FP_EXTEND, MVT::nxv4f32, MVT::nxv4f16, 1}, + { ISD::FP_EXTEND, MVT::nxv8f32, MVT::nxv8f16, 2}, + + // Extend from nxvmf16 to nxvmf64. + { ISD::FP_EXTEND, MVT::nxv2f64, MVT::nxv2f16, 1}, + { ISD::FP_EXTEND, MVT::nxv4f64, MVT::nxv4f16, 2}, + { ISD::FP_EXTEND, MVT::nxv8f64, MVT::nxv8f16, 4}, + + // Extend from nxvmf32 to nxvmf64. + { ISD::FP_EXTEND, MVT::nxv2f64, MVT::nxv2f32, 1}, + { ISD::FP_EXTEND, MVT::nxv4f64, MVT::nxv4f32, 2}, + { ISD::FP_EXTEND, MVT::nxv8f64, MVT::nxv8f32, 6}, + }; if (const auto *Entry = ConvertCostTableLookup(ConversionTbl, ISD, diff --git a/llvm/test/Analysis/CostModel/AArch64/sve-fpext.ll b/llvm/test/Analysis/CostModel/AArch64/sve-fpext.ll new file mode 100644 --- /dev/null +++ b/llvm/test/Analysis/CostModel/AArch64/sve-fpext.ll @@ -0,0 +1,33 @@ +; RUN: opt -cost-model -analyze -mtriple aarch64-linux-gnu -mattr=+sve -S -o - < %s 2>%t | FileCheck %s +; RUN: FileCheck --check-prefix=WARN --allow-empty %s <%t + +; If this check fails please read test/CodeGen/AArch64/README for instructions on how to resolve it. +; WARN-NOT: warning +target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128" +target triple = "aarch64-unknown-linux-gnu" + +define void @sve_fpext() { + ;CHECK-LABEL: 'sve_fpext' + ;CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv2_f16_to_f32 = fpext undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv4_f16_to_f32 = fpext undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv8_f16_to_f32 = fpext undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv2_f16_to_f64 = fpext undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv4_f16_to_f64 = fpext undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %nxv8_f16_to_f64 = fpext undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv2_f32_to_f64 = fpext undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv4_f32_to_f64 = fpext undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %nxv8_f32_to_f64 = fpext undef to + %nxv2_f16_to_f32 = fpext undef to + %nxv4_f16_to_f32 = fpext undef to + %nxv8_f16_to_f32 = fpext undef to + + %nxv2_f16_to_f64 = fpext undef to + %nxv4_f16_to_f64 = fpext undef to + %nxv8_f16_to_f64 = fpext undef to + + %nxv2_f32_to_f64 = fpext undef to + %nxv4_f32_to_f64 = fpext undef to + %nxv8_f32_to_f64 = fpext undef to + + ret void +} diff --git a/llvm/test/Analysis/CostModel/AArch64/sve-fptoi.ll b/llvm/test/Analysis/CostModel/AArch64/sve-fptoi.ll new file mode 100644 --- /dev/null +++ b/llvm/test/Analysis/CostModel/AArch64/sve-fptoi.ll @@ -0,0 +1,91 @@ +; RUN: opt -cost-model -analyze -mtriple aarch64-linux-gnu -mattr=+sve -o - -S < %s 2>%t | FileCheck %s +; RUN: FileCheck --check-prefix=WARN --allow-empty %s <%t + +; If this check fails please read test/CodeGen/AArch64/README for instructions on how to resolve it. +; WARN-NOT: warning +target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128" +target triple = "aarch64-unknown-linux-gnu" + +define void @sve-fptoi() { + ;CHECK-LABEL: 'sve-fptoi' + ;CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv2f32_to_si8 = fptosi undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv2f32_to_ui8 = fptoui undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv2f32_to_si32 = fptosi undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv2f32_to_ui32 = fptoui undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nv2f32_to_si64 = fptosi undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nv2f32_to_ui64 = fptoui undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nv2f64_to_si8 = fptosi undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nv2f64_to_ui8 = fptoui undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nv2f64_to_si32 = fptosi undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nv2f64_to_ui32 = fptoui undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv2f64_to_si64 = fptosi undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv2f64_to_ui64 = fptoui undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nv4f32_to_si8 = fptosi undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nv4f32_to_ui8 = fptoui undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv4f32_to_si32 = fptosi undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv4f32_to_ui32 = fptoui undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %nv4f32_to_si64 = fptosi undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %nv4f32_to_ui64 = fptoui undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nv4f64_to_si8 = fptosi undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nv4f64_to_ui8 = fptoui undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nv4f64_to_si32 = fptosi undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nv4f64_to_ui32 = fptoui undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nv4f64_to_si64 = fptosi undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nv4f64_to_ui64 = fptoui undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv8f32_to_si8 = fptosi undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv8f32_to_ui8 = fptoui undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nv8f32_to_si32 = fptosi undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nv8f32_to_ui32 = fptoui undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nv8f32_to_si64 = fptosi undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nv8f32_to_ui64 = fptoui undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nv8f64_to_si8 = fptosi undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nv8f64_to_ui8 = fptoui undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nv8f64_to_si32 = fptosi undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nv8f64_to_ui32 = fptoui undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %nv8f64_to_si64 = fptosi undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %nv8f64_to_ui64 = fptoui undef to + + %nv2f32_to_si8 = fptosi undef to + %nv2f32_to_ui8 = fptoui undef to + %nv2f32_to_si32 = fptosi undef to + %nv2f32_to_ui32 = fptoui undef to + %nv2f32_to_si64 = fptosi undef to + %nv2f32_to_ui64 = fptoui undef to + + %nv2f64_to_si8 = fptosi undef to + %nv2f64_to_ui8 = fptoui undef to + %nv2f64_to_si32 = fptosi undef to + %nv2f64_to_ui32 = fptoui undef to + %nv2f64_to_si64 = fptosi undef to + %nv2f64_to_ui64 = fptoui undef to + + %nv4f32_to_si8 = fptosi undef to + %nv4f32_to_ui8 = fptoui undef to + %nv4f32_to_si32 = fptosi undef to + %nv4f32_to_ui32 = fptoui undef to + %nv4f32_to_si64 = fptosi undef to + %nv4f32_to_ui64 = fptoui undef to + + %nv4f64_to_si8 = fptosi undef to + %nv4f64_to_ui8 = fptoui undef to + %nv4f64_to_si32 = fptosi undef to + %nv4f64_to_ui32 = fptoui undef to + %nv4f64_to_si64 = fptosi undef to + %nv4f64_to_ui64 = fptoui undef to + + %nv8f32_to_si8 = fptosi undef to + %nv8f32_to_ui8 = fptoui undef to + %nv8f32_to_si32 = fptosi undef to + %nv8f32_to_ui32 = fptoui undef to + %nv8f32_to_si64 = fptosi undef to + %nv8f32_to_ui64 = fptoui undef to + + %nv8f64_to_si8 = fptosi undef to + %nv8f64_to_ui8 = fptoui undef to + %nv8f64_to_si32 = fptosi undef to + %nv8f64_to_ui32 = fptoui undef to + %nv8f64_to_si64 = fptosi undef to + %nv8f64_to_ui64 = fptoui undef to + + ret void +} diff --git a/llvm/test/Analysis/CostModel/AArch64/sve-fptrunc.ll b/llvm/test/Analysis/CostModel/AArch64/sve-fptrunc.ll new file mode 100644 --- /dev/null +++ b/llvm/test/Analysis/CostModel/AArch64/sve-fptrunc.ll @@ -0,0 +1,33 @@ +; RUN: opt -cost-model -analyze -mtriple aarch64-linux-gnu -mattr=+sve -S -o - < %s 2>%t| FileCheck %s +; RUN: FileCheck --check-prefix=WARN --allow-empty %s <%t + +; If this check fails please read test/CodeGen/AArch64/README for instructions on how to resolve it. +; WARN-NOT: warning +target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128" +target triple = "aarch64-unknown-linux-gnu" + +define void @sve_fptruncs() { + ;CHECK-LABEL: 'sve_fptruncs' + ;CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv2_f16_from_f32 = fptrunc undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv4_f16_from_f32 = fptrunc undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %nxv8_f16_from_f32 = fptrunc undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv2_f16_from_f64 = fptrunc undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %nxv4_f16_from_f64 = fptrunc undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %nxv8_f16_from_f64 = fptrunc undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv2_f32_from_f64 = fptrunc undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %nxv4_f32_from_f64 = fptrunc undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %nxv8_f32_from_f64 = fptrunc undef to + %nxv2_f16_from_f32 = fptrunc undef to + %nxv4_f16_from_f32 = fptrunc undef to + %nxv8_f16_from_f32 = fptrunc undef to + + %nxv2_f16_from_f64 = fptrunc undef to + %nxv4_f16_from_f64 = fptrunc undef to + %nxv8_f16_from_f64 = fptrunc undef to + + %nxv2_f32_from_f64 = fptrunc undef to + %nxv4_f32_from_f64 = fptrunc undef to + %nxv8_f32_from_f64 = fptrunc undef to + + ret void +} diff --git a/llvm/test/Analysis/CostModel/AArch64/sve-trunc.ll b/llvm/test/Analysis/CostModel/AArch64/sve-trunc.ll --- a/llvm/test/Analysis/CostModel/AArch64/sve-trunc.ll +++ b/llvm/test/Analysis/CostModel/AArch64/sve-trunc.ll @@ -4,11 +4,43 @@ ; If this check fails please read test/CodeGen/AArch64/README for instructions on how to resolve it. ; WARN-NOT: warning -; CHECK: Found an estimated cost of 0 for instruction: %0 = trunc %v to +define void @sve_truncs() { + ;CHECK-LABEL: 'sve_truncs' + ;CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %trunc_v2i16_to_i1 = trunc undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %trunc_v2i32_to_i1 = trunc undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %trunc_v2i64_to_i1 = trunc undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %trunc_v4i16_to_i1 = trunc undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %trunc_v4i32_to_i1 = trunc undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %trunc_v4i64_to_i1 = trunc undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %trunc_v8i16_to_i1 = trunc undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %trunc_v8i32_to_i1 = trunc undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %trunc_v8i64_to_i1 = trunc undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %trunc_v2i32_to_i16 = trunc undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %trunc_v2i64_to_i32 = trunc undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %trunc_v4i32_to_i16 = trunc undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %trunc_v4i64_to_i32 = trunc undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %trunc_v8i32_to_i16 = trunc undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %trunc_v8i64_to_i32 = trunc undef to + %trunc_v2i16_to_i1 = trunc undef to + %trunc_v2i32_to_i1 = trunc undef to + %trunc_v2i64_to_i1 = trunc undef to + + %trunc_v4i16_to_i1 = trunc undef to + %trunc_v4i32_to_i1 = trunc undef to + %trunc_v4i64_to_i1 = trunc undef to + + %trunc_v8i16_to_i1 = trunc undef to + %trunc_v8i32_to_i1 = trunc undef to + %trunc_v8i64_to_i1 = trunc undef to + + %trunc_v2i32_to_i16 = trunc undef to + %trunc_v2i64_to_i32 = trunc undef to + + %trunc_v4i32_to_i16 = trunc undef to + %trunc_v4i64_to_i32 = trunc undef to + + %trunc_v8i32_to_i16 = trunc undef to + %trunc_v8i64_to_i32 = trunc undef to -define void @trunc_nxv2i64_to_nxv2i32(* %ptr, %v) { -entry: - %0 = trunc %v to - store %0, * %ptr ret void }