Skip to content

Commit 20d9d79

Browse files
committed
address the comment
1 parent d3e0c4a commit 20d9d79

File tree

1 file changed

+20
-40
lines changed

1 file changed

+20
-40
lines changed

llvm/test/Analysis/CostModel/RISCV/fp-min-max-abs.ll

Lines changed: 20 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
2-
; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output -S -mtriple=riscv64 -mattr=+v,+f,+d,+zfh,+zvfh | FileCheck %s --check-prefixes=CHECK,ZVFH
2+
; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output -S -mtriple=riscv64 -mattr=+v,+f,+d,+zfh,+zvfh,+zvfbfmin | FileCheck %s --check-prefixes=CHECK,ZVFH
33
; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output -S -mtriple=riscv64 -mattr=+v,+f,+d,+zfh,+zvfhmin,+zvfbfmin | FileCheck %s --check-prefixes=CHECK,ZVFHMIN
44

55
define void @fabs() {
@@ -48,45 +48,25 @@ define void @fabs() {
4848
}
4949

5050
define void @fabs_f16() {
51-
; ZVFH-LABEL: 'fabs_f16'
52-
; ZVFH-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = call half @llvm.fabs.f16(half undef)
53-
; ZVFH-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %2 = call <2 x bfloat> @llvm.fabs.v2bf16(<2 x bfloat> undef)
54-
; ZVFH-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %3 = call <4 x bfloat> @llvm.fabs.v4bf16(<4 x bfloat> undef)
55-
; ZVFH-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %4 = call <8 x bfloat> @llvm.fabs.v8bf16(<8 x bfloat> undef)
56-
; ZVFH-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %5 = call <16 x bfloat> @llvm.fabs.v16bf16(<16 x bfloat> undef)
57-
; ZVFH-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %6 = call <2 x half> @llvm.fabs.v2f16(<2 x half> undef)
58-
; ZVFH-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %7 = call <4 x half> @llvm.fabs.v4f16(<4 x half> undef)
59-
; ZVFH-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %8 = call <8 x half> @llvm.fabs.v8f16(<8 x half> undef)
60-
; ZVFH-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %9 = call <16 x half> @llvm.fabs.v16f16(<16 x half> undef)
61-
; ZVFH-NEXT: Cost Model: Invalid cost for instruction: %10 = call <vscale x 2 x bfloat> @llvm.fabs.nxv2bf16(<vscale x 2 x bfloat> undef)
62-
; ZVFH-NEXT: Cost Model: Invalid cost for instruction: %11 = call <vscale x 4 x bfloat> @llvm.fabs.nxv4bf16(<vscale x 4 x bfloat> undef)
63-
; ZVFH-NEXT: Cost Model: Invalid cost for instruction: %12 = call <vscale x 8 x bfloat> @llvm.fabs.nxv8bf16(<vscale x 8 x bfloat> undef)
64-
; ZVFH-NEXT: Cost Model: Invalid cost for instruction: %13 = call <vscale x 16 x bfloat> @llvm.fabs.nxv16bf16(<vscale x 16 x bfloat> undef)
65-
; ZVFH-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %14 = call <vscale x 2 x half> @llvm.fabs.nxv2f16(<vscale x 2 x half> undef)
66-
; ZVFH-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %15 = call <vscale x 4 x half> @llvm.fabs.nxv4f16(<vscale x 4 x half> undef)
67-
; ZVFH-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %16 = call <vscale x 8 x half> @llvm.fabs.nxv8f16(<vscale x 8 x half> undef)
68-
; ZVFH-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %17 = call <vscale x 16 x half> @llvm.fabs.nxv16f16(<vscale x 16 x half> undef)
69-
; ZVFH-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
70-
;
71-
; ZVFHMIN-LABEL: 'fabs_f16'
72-
; ZVFHMIN-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = call half @llvm.fabs.f16(half undef)
73-
; ZVFHMIN-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %2 = call <2 x bfloat> @llvm.fabs.v2bf16(<2 x bfloat> undef)
74-
; ZVFHMIN-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %3 = call <4 x bfloat> @llvm.fabs.v4bf16(<4 x bfloat> undef)
75-
; ZVFHMIN-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %4 = call <8 x bfloat> @llvm.fabs.v8bf16(<8 x bfloat> undef)
76-
; ZVFHMIN-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %5 = call <16 x bfloat> @llvm.fabs.v16bf16(<16 x bfloat> undef)
77-
; ZVFHMIN-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %6 = call <2 x half> @llvm.fabs.v2f16(<2 x half> undef)
78-
; ZVFHMIN-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %7 = call <4 x half> @llvm.fabs.v4f16(<4 x half> undef)
79-
; ZVFHMIN-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %8 = call <8 x half> @llvm.fabs.v8f16(<8 x half> undef)
80-
; ZVFHMIN-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %9 = call <16 x half> @llvm.fabs.v16f16(<16 x half> undef)
81-
; ZVFHMIN-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %10 = call <vscale x 2 x bfloat> @llvm.fabs.nxv2bf16(<vscale x 2 x bfloat> undef)
82-
; ZVFHMIN-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %11 = call <vscale x 4 x bfloat> @llvm.fabs.nxv4bf16(<vscale x 4 x bfloat> undef)
83-
; ZVFHMIN-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %12 = call <vscale x 8 x bfloat> @llvm.fabs.nxv8bf16(<vscale x 8 x bfloat> undef)
84-
; ZVFHMIN-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %13 = call <vscale x 16 x bfloat> @llvm.fabs.nxv16bf16(<vscale x 16 x bfloat> undef)
85-
; ZVFHMIN-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %14 = call <vscale x 2 x half> @llvm.fabs.nxv2f16(<vscale x 2 x half> undef)
86-
; ZVFHMIN-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %15 = call <vscale x 4 x half> @llvm.fabs.nxv4f16(<vscale x 4 x half> undef)
87-
; ZVFHMIN-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %16 = call <vscale x 8 x half> @llvm.fabs.nxv8f16(<vscale x 8 x half> undef)
88-
; ZVFHMIN-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %17 = call <vscale x 16 x half> @llvm.fabs.nxv16f16(<vscale x 16 x half> undef)
89-
; ZVFHMIN-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
51+
; CHECK-LABEL: 'fabs_f16'
52+
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = call half @llvm.fabs.f16(half undef)
53+
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %2 = call <2 x bfloat> @llvm.fabs.v2bf16(<2 x bfloat> undef)
54+
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %3 = call <4 x bfloat> @llvm.fabs.v4bf16(<4 x bfloat> undef)
55+
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %4 = call <8 x bfloat> @llvm.fabs.v8bf16(<8 x bfloat> undef)
56+
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %5 = call <16 x bfloat> @llvm.fabs.v16bf16(<16 x bfloat> undef)
57+
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %6 = call <2 x half> @llvm.fabs.v2f16(<2 x half> undef)
58+
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %7 = call <4 x half> @llvm.fabs.v4f16(<4 x half> undef)
59+
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %8 = call <8 x half> @llvm.fabs.v8f16(<8 x half> undef)
60+
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %9 = call <16 x half> @llvm.fabs.v16f16(<16 x half> undef)
61+
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %10 = call <vscale x 2 x bfloat> @llvm.fabs.nxv2bf16(<vscale x 2 x bfloat> undef)
62+
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %11 = call <vscale x 4 x bfloat> @llvm.fabs.nxv4bf16(<vscale x 4 x bfloat> undef)
63+
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %12 = call <vscale x 8 x bfloat> @llvm.fabs.nxv8bf16(<vscale x 8 x bfloat> undef)
64+
; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %13 = call <vscale x 16 x bfloat> @llvm.fabs.nxv16bf16(<vscale x 16 x bfloat> undef)
65+
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %14 = call <vscale x 2 x half> @llvm.fabs.nxv2f16(<vscale x 2 x half> undef)
66+
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %15 = call <vscale x 4 x half> @llvm.fabs.nxv4f16(<vscale x 4 x half> undef)
67+
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %16 = call <vscale x 8 x half> @llvm.fabs.nxv8f16(<vscale x 8 x half> undef)
68+
; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %17 = call <vscale x 16 x half> @llvm.fabs.nxv16f16(<vscale x 16 x half> undef)
69+
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
9070
;
9171
call half @llvm.fabs.f16(half undef)
9272
call <2 x bfloat> @llvm.fabs.v2f16(<2 x bfloat> undef)

0 commit comments

Comments
 (0)