You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: llvm/test/Analysis/CostModel/RISCV/fp-sqrt-pow.ll
+41-31Lines changed: 41 additions & 31 deletions
Original file line number
Diff line number
Diff line change
@@ -9,40 +9,44 @@ define void @sqrt() {
9
9
; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %3 = call <4 x bfloat> @llvm.sqrt.v4bf16(<4 x bfloat> undef)
10
10
; CHECK-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %4 = call <8 x bfloat> @llvm.sqrt.v8bf16(<8 x bfloat> undef)
11
11
; CHECK-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %5 = call <16 x bfloat> @llvm.sqrt.v16bf16(<16 x bfloat> undef)
12
-
; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %6 = call <vscale x 2 x bfloat> @llvm.sqrt.nxv2bf16(<vscale x 2 x bfloat> undef)
13
-
; CHECK-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %7 = call <vscale x 4 x bfloat> @llvm.sqrt.nxv4bf16(<vscale x 4 x bfloat> undef)
14
-
; CHECK-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %8 = call <vscale x 8 x bfloat> @llvm.sqrt.nxv8bf16(<vscale x 8 x bfloat> undef)
15
-
; CHECK-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %9 = call <vscale x 16 x bfloat> @llvm.sqrt.nxv16bf16(<vscale x 16 x bfloat> undef)
16
-
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %10 = call float @llvm.sqrt.f32(float undef)
17
-
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %11 = call <2 x float> @llvm.sqrt.v2f32(<2 x float> undef)
18
-
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %12 = call <4 x float> @llvm.sqrt.v4f32(<4 x float> undef)
19
-
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %13 = call <8 x float> @llvm.sqrt.v8f32(<8 x float> undef)
20
-
; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %14 = call <16 x float> @llvm.sqrt.v16f32(<16 x float> undef)
21
-
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %15 = call <vscale x 1 x float> @llvm.sqrt.nxv1f32(<vscale x 1 x float> undef)
22
-
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %16 = call <vscale x 2 x float> @llvm.sqrt.nxv2f32(<vscale x 2 x float> undef)
23
-
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %17 = call <vscale x 4 x float> @llvm.sqrt.nxv4f32(<vscale x 4 x float> undef)
24
-
; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %18 = call <vscale x 8 x float> @llvm.sqrt.nxv8f32(<vscale x 8 x float> undef)
25
-
; CHECK-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %19 = call <vscale x 16 x float> @llvm.sqrt.nxv16f32(<vscale x 16 x float> undef)
26
-
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %20 = call double @llvm.sqrt.f64(double undef)
27
-
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %21 = call <2 x double> @llvm.sqrt.v2f64(<2 x double> undef)
28
-
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %22 = call <4 x double> @llvm.sqrt.v4f64(<4 x double> undef)
29
-
; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %23 = call <8 x double> @llvm.sqrt.v8f64(<8 x double> undef)
30
-
; CHECK-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %24 = call <16 x double> @llvm.sqrt.v16f64(<16 x double> undef)
31
-
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %25 = call <vscale x 1 x double> @llvm.sqrt.nxv1f64(<vscale x 1 x double> undef)
32
-
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %26 = call <vscale x 2 x double> @llvm.sqrt.nxv2f64(<vscale x 2 x double> undef)
33
-
; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %27 = call <vscale x 4 x double> @llvm.sqrt.nxv4f64(<vscale x 4 x double> undef)
34
-
; CHECK-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %28 = call <vscale x 8 x double> @llvm.sqrt.nxv8f64(<vscale x 8 x double> undef)
12
+
; CHECK-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %6 = call <32 x bfloat> @llvm.sqrt.v32bf16(<32 x bfloat> undef)
13
+
; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %7 = call <vscale x 2 x bfloat> @llvm.sqrt.nxv2bf16(<vscale x 2 x bfloat> undef)
14
+
; CHECK-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %8 = call <vscale x 4 x bfloat> @llvm.sqrt.nxv4bf16(<vscale x 4 x bfloat> undef)
15
+
; CHECK-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %9 = call <vscale x 8 x bfloat> @llvm.sqrt.nxv8bf16(<vscale x 8 x bfloat> undef)
16
+
; CHECK-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %10 = call <vscale x 16 x bfloat> @llvm.sqrt.nxv16bf16(<vscale x 16 x bfloat> undef)
17
+
; CHECK-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %11 = call <vscale x 32 x bfloat> @llvm.sqrt.nxv32bf16(<vscale x 32 x bfloat> undef)
18
+
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %12 = call float @llvm.sqrt.f32(float undef)
19
+
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %13 = call <2 x float> @llvm.sqrt.v2f32(<2 x float> undef)
20
+
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %14 = call <4 x float> @llvm.sqrt.v4f32(<4 x float> undef)
21
+
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %15 = call <8 x float> @llvm.sqrt.v8f32(<8 x float> undef)
22
+
; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %16 = call <16 x float> @llvm.sqrt.v16f32(<16 x float> undef)
23
+
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %17 = call <vscale x 1 x float> @llvm.sqrt.nxv1f32(<vscale x 1 x float> undef)
24
+
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %18 = call <vscale x 2 x float> @llvm.sqrt.nxv2f32(<vscale x 2 x float> undef)
25
+
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %19 = call <vscale x 4 x float> @llvm.sqrt.nxv4f32(<vscale x 4 x float> undef)
26
+
; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %20 = call <vscale x 8 x float> @llvm.sqrt.nxv8f32(<vscale x 8 x float> undef)
27
+
; CHECK-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %21 = call <vscale x 16 x float> @llvm.sqrt.nxv16f32(<vscale x 16 x float> undef)
28
+
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %22 = call double @llvm.sqrt.f64(double undef)
29
+
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %23 = call <2 x double> @llvm.sqrt.v2f64(<2 x double> undef)
30
+
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %24 = call <4 x double> @llvm.sqrt.v4f64(<4 x double> undef)
31
+
; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %25 = call <8 x double> @llvm.sqrt.v8f64(<8 x double> undef)
32
+
; CHECK-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %26 = call <16 x double> @llvm.sqrt.v16f64(<16 x double> undef)
33
+
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %27 = call <vscale x 1 x double> @llvm.sqrt.nxv1f64(<vscale x 1 x double> undef)
34
+
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %28 = call <vscale x 2 x double> @llvm.sqrt.nxv2f64(<vscale x 2 x double> undef)
35
+
; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %29 = call <vscale x 4 x double> @llvm.sqrt.nxv4f64(<vscale x 4 x double> undef)
36
+
; CHECK-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %30 = call <vscale x 8 x double> @llvm.sqrt.nxv8f64(<vscale x 8 x double> undef)
35
37
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
36
38
;
37
39
call bfloat @llvm.sqrt.bf16(bfloat undef)
38
40
call <2 x bfloat> @llvm.sqrt.v2bf16(<2 x bfloat> undef)
39
41
call <4 x bfloat> @llvm.sqrt.v4bf16(<4 x bfloat> undef)
40
42
call <8 x bfloat> @llvm.sqrt.v8bf16(<8 x bfloat> undef)
41
43
call <16 x bfloat> @llvm.sqrt.v16bf16(<16 x bfloat> undef)
44
+
call <32 x bfloat> @llvm.sqrt.v32bf16(<32 x bfloat> undef)
42
45
call <vscale x 2 x bfloat> @llvm.sqrt.nxv2bf16(<vscale x 2 x bfloat> undef)
43
46
call <vscale x 4 x bfloat> @llvm.sqrt.nxv4bf16(<vscale x 4 x bfloat> undef)
44
47
call <vscale x 8 x bfloat> @llvm.sqrt.nxv8bf16(<vscale x 8 x bfloat> undef)
45
48
call <vscale x 16 x bfloat> @llvm.sqrt.nxv16bf16(<vscale x 16 x bfloat> undef)
49
+
call <vscale x 32 x bfloat> @llvm.sqrt.nxv32bf16(<vscale x 32 x bfloat> undef)
46
50
callfloat@llvm.sqrt.f32(floatundef)
47
51
call <2 x float> @llvm.sqrt.v2f32(<2 x float> undef)
48
52
call <4 x float> @llvm.sqrt.v4f32(<4 x float> undef)
@@ -72,10 +76,12 @@ define void @sqrt_f16() {
72
76
; ZVFH-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %3 = call <4 x half> @llvm.sqrt.v4f16(<4 x half> undef)
73
77
; ZVFH-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %4 = call <8 x half> @llvm.sqrt.v8f16(<8 x half> undef)
74
78
; ZVFH-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %5 = call <16 x half> @llvm.sqrt.v16f16(<16 x half> undef)
75
-
; ZVFH-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %6 = call <vscale x 2 x half> @llvm.sqrt.nxv2f16(<vscale x 2 x half> undef)
76
-
; ZVFH-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %7 = call <vscale x 4 x half> @llvm.sqrt.nxv4f16(<vscale x 4 x half> undef)
77
-
; ZVFH-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %8 = call <vscale x 8 x half> @llvm.sqrt.nxv8f16(<vscale x 8 x half> undef)
78
-
; ZVFH-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %9 = call <vscale x 16 x half> @llvm.sqrt.nxv16f16(<vscale x 16 x half> undef)
79
+
; ZVFH-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %6 = call <32 x half> @llvm.sqrt.v32f16(<32 x half> undef)
80
+
; ZVFH-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %7 = call <vscale x 2 x half> @llvm.sqrt.nxv2f16(<vscale x 2 x half> undef)
81
+
; ZVFH-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %8 = call <vscale x 4 x half> @llvm.sqrt.nxv4f16(<vscale x 4 x half> undef)
82
+
; ZVFH-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %9 = call <vscale x 8 x half> @llvm.sqrt.nxv8f16(<vscale x 8 x half> undef)
83
+
; ZVFH-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %10 = call <vscale x 16 x half> @llvm.sqrt.nxv16f16(<vscale x 16 x half> undef)
84
+
; ZVFH-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %11 = call <vscale x 32 x half> @llvm.sqrt.nxv32f16(<vscale x 32 x half> undef)
79
85
; ZVFH-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
80
86
;
81
87
; ZVFHMIN-LABEL: 'sqrt_f16'
@@ -84,21 +90,25 @@ define void @sqrt_f16() {
84
90
; ZVFHMIN-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %3 = call <4 x half> @llvm.sqrt.v4f16(<4 x half> undef)
85
91
; ZVFHMIN-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %4 = call <8 x half> @llvm.sqrt.v8f16(<8 x half> undef)
86
92
; ZVFHMIN-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %5 = call <16 x half> @llvm.sqrt.v16f16(<16 x half> undef)
87
-
; ZVFHMIN-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %6 = call <vscale x 2 x half> @llvm.sqrt.nxv2f16(<vscale x 2 x half> undef)
88
-
; ZVFHMIN-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %7 = call <vscale x 4 x half> @llvm.sqrt.nxv4f16(<vscale x 4 x half> undef)
89
-
; ZVFHMIN-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %8 = call <vscale x 8 x half> @llvm.sqrt.nxv8f16(<vscale x 8 x half> undef)
90
-
; ZVFHMIN-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %9 = call <vscale x 16 x half> @llvm.sqrt.nxv16f16(<vscale x 16 x half> undef)
93
+
; ZVFHMIN-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %6 = call <32 x half> @llvm.sqrt.v32f16(<32 x half> undef)
94
+
; ZVFHMIN-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %7 = call <vscale x 2 x half> @llvm.sqrt.nxv2f16(<vscale x 2 x half> undef)
95
+
; ZVFHMIN-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %8 = call <vscale x 4 x half> @llvm.sqrt.nxv4f16(<vscale x 4 x half> undef)
96
+
; ZVFHMIN-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %9 = call <vscale x 8 x half> @llvm.sqrt.nxv8f16(<vscale x 8 x half> undef)
97
+
; ZVFHMIN-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %10 = call <vscale x 16 x half> @llvm.sqrt.nxv16f16(<vscale x 16 x half> undef)
98
+
; ZVFHMIN-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %11 = call <vscale x 32 x half> @llvm.sqrt.nxv32f16(<vscale x 32 x half> undef)
91
99
; ZVFHMIN-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
92
100
;
93
101
callhalf@llvm.sqrt.f16(halfundef)
94
102
call <2 x half> @llvm.sqrt.v2f16(<2 x half> undef)
95
103
call <4 x half> @llvm.sqrt.v4f16(<4 x half> undef)
96
104
call <8 x half> @llvm.sqrt.v8f16(<8 x half> undef)
97
105
call <16 x half> @llvm.sqrt.v16f16(<16 x half> undef)
106
+
call <32 x half> @llvm.sqrt.v32f16(<32 x half> undef)
98
107
call <vscale x 2 x half> @llvm.sqrt.nxv2f16(<vscale x 2 x half> undef)
99
108
call <vscale x 4 x half> @llvm.sqrt.nxv4f16(<vscale x 4 x half> undef)
100
109
call <vscale x 8 x half> @llvm.sqrt.nxv8f16(<vscale x 8 x half> undef)
101
110
call <vscale x 16 x half> @llvm.sqrt.nxv16f16(<vscale x 16 x half> undef)
111
+
call <vscale x 32 x half> @llvm.sqrt.nxv32f16(<vscale x 32 x half> undef)
0 commit comments