; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 3 ; RUN: opt -passes="print" -cost-kind=all 2>&1 -disable-output -mtriple aarch64-linux-gnu -mattr=+sve -S -o - < %s | FileCheck %s --check-prefixes=CHECK,CHECK-SVE ; RUN: opt -passes="print" -cost-kind=all 2>&1 -disable-output -mtriple aarch64-linux-gnu -mattr=+sve2 -S -o - < %s | FileCheck %s --check-prefixes=CHECK,CHECK-SVE2 ; RUN: opt -passes="print" -cost-kind=all 2>&1 -disable-output -mtriple aarch64-linux-gnu -mattr=+sve2,+bf16 -S -o - < %s | FileCheck %s --check-prefixes=CHECK,CHECK-BF16 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 costs of 1 for: %nxv2_f16_from_f32 = fptrunc poison to ; CHECK-NEXT: Cost Model: Found costs of 1 for: %nxv4_f16_from_f32 = fptrunc poison to ; CHECK-NEXT: Cost Model: Found costs of 3 for: %nxv8_f16_from_f32 = fptrunc poison to ; CHECK-NEXT: Cost Model: Found costs of 1 for: %nxv2_f16_from_f64 = fptrunc poison to ; CHECK-NEXT: Cost Model: Found costs of 3 for: %nxv4_f16_from_f64 = fptrunc poison to ; CHECK-NEXT: Cost Model: Found costs of 7 for: %nxv8_f16_from_f64 = fptrunc poison to ; CHECK-NEXT: Cost Model: Found costs of 1 for: %nxv2_f32_from_f64 = fptrunc poison to ; CHECK-NEXT: Cost Model: Found costs of 3 for: %nxv4_f32_from_f64 = fptrunc poison to ; CHECK-NEXT: Cost Model: Found costs of 6 for: %nxv8_f32_from_f64 = fptrunc poison to ; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void ; %nxv2_f16_from_f32 = fptrunc poison to %nxv4_f16_from_f32 = fptrunc poison to %nxv8_f16_from_f32 = fptrunc poison to %nxv2_f16_from_f64 = fptrunc poison to %nxv4_f16_from_f64 = fptrunc poison to %nxv8_f16_from_f64 = fptrunc poison to %nxv2_f32_from_f64 = fptrunc poison to %nxv4_f32_from_f64 = fptrunc poison to %nxv8_f32_from_f64 = fptrunc poison to ret void } define void @sve_fptruncs_bf16() { ; CHECK-SVE-LABEL: 'sve_fptruncs_bf16' ; CHECK-SVE-NEXT: Cost Model: Found costs of 8 for: %nxv2_f16_from_f32 = fptrunc poison to ; CHECK-SVE-NEXT: Cost Model: Found costs of 8 for: %nxv4_f16_from_f32 = fptrunc poison to ; CHECK-SVE-NEXT: Cost Model: Found costs of 17 for: %nxv8_f16_from_f32 = fptrunc poison to ; CHECK-SVE-NEXT: Cost Model: Found costs of Invalid for: %nxv2_f16_from_f64 = fptrunc poison to ; CHECK-SVE-NEXT: Cost Model: Found costs of Invalid for: %nxv4_f16_from_f64 = fptrunc poison to ; CHECK-SVE-NEXT: Cost Model: Found costs of Invalid for: %nxv8_f16_from_f64 = fptrunc poison to ; CHECK-SVE-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void ; ; CHECK-SVE2-LABEL: 'sve_fptruncs_bf16' ; CHECK-SVE2-NEXT: Cost Model: Found costs of 8 for: %nxv2_f16_from_f32 = fptrunc poison to ; CHECK-SVE2-NEXT: Cost Model: Found costs of 8 for: %nxv4_f16_from_f32 = fptrunc poison to ; CHECK-SVE2-NEXT: Cost Model: Found costs of 17 for: %nxv8_f16_from_f32 = fptrunc poison to ; CHECK-SVE2-NEXT: Cost Model: Found costs of 9 for: %nxv2_f16_from_f64 = fptrunc poison to ; CHECK-SVE2-NEXT: Cost Model: Found costs of 19 for: %nxv4_f16_from_f64 = fptrunc poison to ; CHECK-SVE2-NEXT: Cost Model: Found costs of 39 for: %nxv8_f16_from_f64 = fptrunc poison to ; CHECK-SVE2-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void ; ; CHECK-BF16-LABEL: 'sve_fptruncs_bf16' ; CHECK-BF16-NEXT: Cost Model: Found costs of 1 for: %nxv2_f16_from_f32 = fptrunc poison to ; CHECK-BF16-NEXT: Cost Model: Found costs of 1 for: %nxv4_f16_from_f32 = fptrunc poison to ; CHECK-BF16-NEXT: Cost Model: Found costs of 3 for: %nxv8_f16_from_f32 = fptrunc poison to ; CHECK-BF16-NEXT: Cost Model: Found costs of 2 for: %nxv2_f16_from_f64 = fptrunc poison to ; CHECK-BF16-NEXT: Cost Model: Found costs of 5 for: %nxv4_f16_from_f64 = fptrunc poison to ; CHECK-BF16-NEXT: Cost Model: Found costs of 11 for: %nxv8_f16_from_f64 = fptrunc poison to ; CHECK-BF16-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void ; %nxv2_f16_from_f32 = fptrunc poison to %nxv4_f16_from_f32 = fptrunc poison to %nxv8_f16_from_f32 = fptrunc poison to %nxv2_f16_from_f64 = fptrunc poison to %nxv4_f16_from_f64 = fptrunc poison to %nxv8_f16_from_f64 = fptrunc poison to ret void }