; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 5 ; RUN: opt -passes="print" -cost-kind=all 2>&1 -disable-output -mtriple=aarch64--linux-gnu -mattr=+sve < %s | FileCheck %s target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128" ; Check icmp for legal integer vectors. define void @cmp_legal_int() { ; CHECK-LABEL: 'cmp_legal_int' ; CHECK-NEXT: Cost Model: Found costs of 1 for: %1 = icmp ne undef, undef ; CHECK-NEXT: Cost Model: Found costs of 1 for: %2 = icmp ne undef, undef ; CHECK-NEXT: Cost Model: Found costs of 1 for: %3 = icmp ne undef, undef ; CHECK-NEXT: Cost Model: Found costs of 1 for: %4 = icmp ne undef, undef ; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void ; %1 = icmp ne undef, undef %2 = icmp ne undef, undef %3 = icmp ne undef, undef %4 = icmp ne undef, undef ret void } ; Check icmp for an illegal integer vector. define @cmp_nxv4i64() { ; CHECK-LABEL: 'cmp_nxv4i64' ; CHECK-NEXT: Cost Model: Found costs of 2 for: %res = icmp ne undef, undef ; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret %res ; %res = icmp ne undef, undef ret %res } ; Check icmp for legal predicate vectors. define void @cmp_legal_pred() { ; CHECK-LABEL: 'cmp_legal_pred' ; CHECK-NEXT: Cost Model: Found costs of 1 for: %1 = icmp ne undef, undef ; CHECK-NEXT: Cost Model: Found costs of 1 for: %2 = icmp ne undef, undef ; CHECK-NEXT: Cost Model: Found costs of 1 for: %3 = icmp ne undef, undef ; CHECK-NEXT: Cost Model: Found costs of 1 for: %4 = icmp ne undef, undef ; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void ; %1 = icmp ne undef, undef %2 = icmp ne undef, undef %3 = icmp ne undef, undef %4 = icmp ne undef, undef ret void } ; Check icmp for an illegal predicate vector. define @cmp_nxv32i1() { ; CHECK-LABEL: 'cmp_nxv32i1' ; CHECK-NEXT: Cost Model: Found costs of 2 for: %res = icmp ne undef, undef ; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret %res ; %res = icmp ne undef, undef ret %res } ; Check fcmp for legal FP vectors define void @cmp_legal_fp() #0 { ; CHECK-LABEL: 'cmp_legal_fp' ; CHECK-NEXT: Cost Model: Found costs of RThru:2 CodeSize:1 Lat:2 SizeLat:1 for: %1 = fcmp oge undef, undef ; CHECK-NEXT: Cost Model: Found costs of RThru:2 CodeSize:1 Lat:2 SizeLat:1 for: %2 = fcmp oge undef, undef ; CHECK-NEXT: Cost Model: Found costs of RThru:2 CodeSize:1 Lat:2 SizeLat:1 for: %3 = fcmp oge undef, undef ; CHECK-NEXT: Cost Model: Found costs of RThru:13 CodeSize:11 Lat:11 SizeLat:11 for: %4 = fcmp oge undef, undef ; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void ; %1 = fcmp oge undef, undef %2 = fcmp oge undef, undef %3 = fcmp oge undef, undef %4 = fcmp oge undef, undef ret void } ; Check fcmp for an illegal FP vector define @cmp_nxv16f16() { ; CHECK-LABEL: 'cmp_nxv16f16' ; CHECK-NEXT: Cost Model: Found costs of RThru:4 CodeSize:2 Lat:2 SizeLat:2 for: %res = fcmp oge undef, undef ; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret %res ; %res = fcmp oge undef, undef ret %res } ; Check select for legal integer vectors define void @sel_legal_int() { ; CHECK-LABEL: 'sel_legal_int' ; CHECK-NEXT: Cost Model: Found costs of 1 for: %1 = select undef, undef, undef ; CHECK-NEXT: Cost Model: Found costs of 1 for: %2 = select undef, undef, undef ; CHECK-NEXT: Cost Model: Found costs of 1 for: %3 = select undef, undef, undef ; CHECK-NEXT: Cost Model: Found costs of 1 for: %4 = select undef, undef, undef ; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void ; %1 = select undef, undef, undef %2 = select undef, undef, undef %3 = select undef, undef, undef %4 = select undef, undef, undef ret void } ; Check select for an illegal integer vector define @sel_nxv16i16() { ; CHECK-LABEL: 'sel_nxv16i16' ; CHECK-NEXT: Cost Model: Found costs of 2 for: %res = select undef, undef, undef ; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret %res ; %res = select undef, undef, undef ret %res } ; Check select for a legal FP vector define void @sel_legal_fp() #0 { ; CHECK-LABEL: 'sel_legal_fp' ; CHECK-NEXT: Cost Model: Found costs of 1 for: %1 = select undef, undef, undef ; CHECK-NEXT: Cost Model: Found costs of 1 for: %2 = select undef, undef, undef ; CHECK-NEXT: Cost Model: Found costs of 1 for: %3 = select undef, undef, undef ; CHECK-NEXT: Cost Model: Found costs of 1 for: %4 = select undef, undef, undef ; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void ; %1 = select undef, undef, undef %2 = select undef, undef, undef %3 = select undef, undef, undef %4 = select undef, undef, undef ret void } ; Check select for an illegal FP vector define @sel_nxv8f32() { ; CHECK-LABEL: 'sel_nxv8f32' ; CHECK-NEXT: Cost Model: Found costs of 2 for: %res = select undef, undef, undef ; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret %res ; %res = select undef, undef, undef ret %res } ; Check select for a legal predicate vector define void @sel_legal_pred() { ; CHECK-LABEL: 'sel_legal_pred' ; CHECK-NEXT: Cost Model: Found costs of 1 for: %1 = select undef, undef, undef ; CHECK-NEXT: Cost Model: Found costs of 1 for: %2 = select undef, undef, undef ; CHECK-NEXT: Cost Model: Found costs of 1 for: %3 = select undef, undef, undef ; CHECK-NEXT: Cost Model: Found costs of 1 for: %4 = select undef, undef, undef ; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void ; %1 = select undef, undef, undef %2 = select undef, undef, undef %3 = select undef, undef, undef %4 = select undef, undef, undef ret void } ; Check select for an illegal predicate vector define @sel_nxv32i1() { ; CHECK-LABEL: 'sel_nxv32i1' ; CHECK-NEXT: Cost Model: Found costs of 2 for: %res = select undef, undef, undef ; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret %res ; %res = select undef, undef, undef ret %res } define void @uscmp() { ; CHECK-LABEL: 'uscmp' ; CHECK-NEXT: Cost Model: Found costs of 4 for: %uv16i8 = call @llvm.ucmp.nxv16i8.nxv16i8( undef, undef) ; CHECK-NEXT: Cost Model: Found costs of 4 for: %uv8i16 = call @llvm.ucmp.nxv8i16.nxv8i16( undef, undef) ; CHECK-NEXT: Cost Model: Found costs of 4 for: %uv4i32 = call @llvm.ucmp.nxv4i32.nxv4i32( undef, undef) ; CHECK-NEXT: Cost Model: Found costs of 4 for: %uv2i64 = call @llvm.ucmp.nxv2i64.nxv2i64( undef, undef) ; CHECK-NEXT: Cost Model: Found costs of 4 for: %sv16i8 = call @llvm.scmp.nxv16i8.nxv16i8( undef, undef) ; CHECK-NEXT: Cost Model: Found costs of 4 for: %sv8i16 = call @llvm.scmp.nxv8i16.nxv8i16( undef, undef) ; CHECK-NEXT: Cost Model: Found costs of 4 for: %sv4i32 = call @llvm.scmp.nxv4i32.nxv4i32( undef, undef) ; CHECK-NEXT: Cost Model: Found costs of 4 for: %sv2i64 = call @llvm.scmp.nxv2i64.nxv2i64( undef, undef) ; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void ; %uv16i8 = call @llvm.ucmp( undef, undef) %uv8i16 = call @llvm.ucmp( undef, undef) %uv4i32 = call @llvm.ucmp( undef, undef) %uv2i64 = call @llvm.ucmp( undef, undef) %sv16i8 = call @llvm.scmp( undef, undef) %sv8i16 = call @llvm.scmp( undef, undef) %sv4i32 = call @llvm.scmp( undef, undef) %sv2i64 = call @llvm.scmp( undef, undef) ret void } attributes #0 = { "target-features"="+sve,+bf16" }