; RUN: opt -cost-model -analyze -mtriple=aarch64--linux-gnu -mattr=+sve < %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 ; Check icmp for legal integer vectors. define void @cmp_legal_int() { ; CHECK-LABEL: 'cmp_legal_int' ; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %1 = icmp ne undef, undef ; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %2 = icmp ne undef, undef ; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %3 = icmp ne undef, undef ; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %4 = icmp ne undef, undef %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: Cost Model: Found an estimated cost of 2 for instruction: %res = icmp ne undef, undef ; CHECK: Cost Model: Found an estimated cost of 0 for instruction: 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: Cost Model: Found an estimated cost of 1 for instruction: %1 = icmp ne undef, undef ; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %2 = icmp ne undef, undef ; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %3 = icmp ne undef, undef ; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %4 = icmp ne undef, undef %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: Cost Model: Found an estimated cost of 2 for instruction: %res = icmp ne undef, undef ; CHECK: Cost Model: Found an estimated cost of 0 for instruction: 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: Cost Model: Found an estimated cost of 1 for instruction: %1 = fcmp oge undef, undef ; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %2 = fcmp oge undef, undef ; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %3 = fcmp oge undef, undef ; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %4 = fcmp oge undef, undef %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: Cost Model: Found an estimated cost of 2 for instruction: %res = fcmp oge undef, undef ; CHECK: Cost Model: Found an estimated cost of 0 for instruction: 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: Cost Model: Found an estimated cost of 1 for instruction: %1 = select undef, undef, undef ; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %2 = select undef, undef, undef ; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %3 = select undef, undef, undef ; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %4 = select undef, undef, undef %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: Cost Model: Found an estimated cost of 2 for instruction: %res = select undef, undef, undef ; CHECK: Cost Model: Found an estimated cost of 0 for instruction: 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: Cost Model: Found an estimated cost of 1 for instruction: %1 = select undef, undef, undef ; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %2 = select undef, undef, undef ; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %3 = select undef, undef, undef ; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %4 = select undef, undef, undef %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: Cost Model: Found an estimated cost of 2 for instruction: %res = select undef, undef, undef ; CHECK: Cost Model: Found an estimated cost of 0 for instruction: 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: Cost Model: Found an estimated cost of 1 for instruction: %1 = select undef, undef, undef ; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %2 = select undef, undef, undef ; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %3 = select undef, undef, undef ; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %4 = select undef, undef, undef %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: Cost Model: Found an estimated cost of 2 for instruction: %res = select undef, undef, undef ; CHECK: Cost Model: Found an estimated cost of 0 for instruction: ret %res %res = select undef, undef, undef ret %res } attributes #0 = { "target-features"="+sve,+bf16" }