1 ; 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 -riscv-v-vector-bits-min=-1 | FileCheck %s
6 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = call half @llvm.sqrt.f16(half undef)
7 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %2 = call <2 x half> @llvm.sqrt.v2f16(<2 x half> undef)
8 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %3 = call <4 x half> @llvm.sqrt.v4f16(<4 x half> undef)
9 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %4 = call <8 x half> @llvm.sqrt.v8f16(<8 x half> undef)
10 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %5 = call <16 x half> @llvm.sqrt.v16f16(<16 x half> undef)
11 ; CHECK-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)
12 ; CHECK-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)
13 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %8 = call <vscale x 8 x half> @llvm.sqrt.nxv8f16(<vscale x 8 x half> undef)
14 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %9 = call <vscale x 16 x half> @llvm.sqrt.nxv16f16(<vscale x 16 x half> undef)
15 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %10 = call float @llvm.sqrt.f32(float undef)
16 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %11 = call <2 x float> @llvm.sqrt.v2f32(<2 x float> undef)
17 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %12 = call <4 x float> @llvm.sqrt.v4f32(<4 x float> undef)
18 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %13 = call <8 x float> @llvm.sqrt.v8f32(<8 x float> undef)
19 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %14 = call <16 x float> @llvm.sqrt.v16f32(<16 x float> undef)
20 ; 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)
21 ; 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)
22 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %17 = call <vscale x 4 x float> @llvm.sqrt.nxv4f32(<vscale x 4 x float> undef)
23 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %18 = call <vscale x 8 x float> @llvm.sqrt.nxv8f32(<vscale x 8 x float> undef)
24 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %19 = call <vscale x 16 x float> @llvm.sqrt.nxv16f32(<vscale x 16 x float> undef)
25 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %20 = call double @llvm.sqrt.f64(double undef)
26 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %21 = call <2 x double> @llvm.sqrt.v2f64(<2 x double> undef)
27 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %22 = call <4 x double> @llvm.sqrt.v4f64(<4 x double> undef)
28 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %23 = call <8 x double> @llvm.sqrt.v8f64(<8 x double> undef)
29 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %24 = call <16 x double> @llvm.sqrt.v16f64(<16 x double> undef)
30 ; 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)
31 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %26 = call <vscale x 2 x double> @llvm.sqrt.nxv2f64(<vscale x 2 x double> undef)
32 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %27 = call <vscale x 4 x double> @llvm.sqrt.nxv4f64(<vscale x 4 x double> undef)
33 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %28 = call <vscale x 8 x double> @llvm.sqrt.nxv8f64(<vscale x 8 x double> undef)
34 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
36 call half @llvm.sqrt.f16(half undef)
37 call <2 x half> @llvm.sqrt.v2f16(<2 x half> undef)
38 call <4 x half> @llvm.sqrt.v4f16(<4 x half> undef)
39 call <8 x half> @llvm.sqrt.v8f16(<8 x half> undef)
40 call <16 x half> @llvm.sqrt.v16f16(<16 x half> undef)
41 call <vscale x 2 x half> @llvm.sqrt.nvx2f16(<vscale x 2 x half> undef)
42 call <vscale x 4 x half> @llvm.sqrt.nvx4f16(<vscale x 4 x half> undef)
43 call <vscale x 8 x half> @llvm.sqrt.nvx8f16(<vscale x 8 x half> undef)
44 call <vscale x 16 x half> @llvm.sqrt.nvx16f16(<vscale x 16 x half> undef)
45 call float @llvm.sqrt.f32(float undef)
46 call <2 x float> @llvm.sqrt.v2f32(<2 x float> undef)
47 call <4 x float> @llvm.sqrt.v4f32(<4 x float> undef)
48 call <8 x float> @llvm.sqrt.v8f32(<8 x float> undef)
49 call <16 x float> @llvm.sqrt.v16f32(<16 x float> undef)
50 call <vscale x 1 x float> @llvm.sqrt.nvx1f32(<vscale x 1 x float> undef)
51 call <vscale x 2 x float> @llvm.sqrt.nvx2f32(<vscale x 2 x float> undef)
52 call <vscale x 4 x float> @llvm.sqrt.nvx4f32(<vscale x 4 x float> undef)
53 call <vscale x 8 x float> @llvm.sqrt.nvx8f32(<vscale x 8 x float> undef)
54 call <vscale x 16 x float> @llvm.sqrt.nvx16f32(<vscale x 16 x float> undef)
55 call double @llvm.sqrt.f64(double undef)
56 call <2 x double> @llvm.sqrt.v2f64(<2 x double> undef)
57 call <4 x double> @llvm.sqrt.v4f64(<4 x double> undef)
58 call <8 x double> @llvm.sqrt.v8f64(<8 x double> undef)
59 call <16 x double> @llvm.sqrt.v16f64(<16 x double> undef)
60 call <vscale x 1 x double> @llvm.sqrt.nvx1f64(<vscale x 1 x double> undef)
61 call <vscale x 2 x double> @llvm.sqrt.nvx2f64(<vscale x 2 x double> undef)
62 call <vscale x 4 x double> @llvm.sqrt.nvx4f64(<vscale x 4 x double> undef)
63 call <vscale x 8 x double> @llvm.sqrt.nvx8f64(<vscale x 8 x double> undef)
67 declare half @llvm.sqrt.f16(half)
68 declare <2 x half> @llvm.sqrt.v2f16(<2 x half>)
69 declare <4 x half> @llvm.sqrt.v4f16(<4 x half>)
70 declare <8 x half> @llvm.sqrt.v8f16(<8 x half>)
71 declare <16 x half> @llvm.sqrt.v16f16(<16 x half>)
72 declare <vscale x 2 x half> @llvm.sqrt.nvx2f16(<vscale x 2 x half>)
73 declare <vscale x 4 x half> @llvm.sqrt.nvx4f16(<vscale x 4 x half>)
74 declare <vscale x 8 x half> @llvm.sqrt.nvx8f16(<vscale x 8 x half>)
75 declare <vscale x 16 x half> @llvm.sqrt.nvx16f16(<vscale x 16 x half>)
76 declare float @llvm.sqrt.f32(float)
77 declare <2 x float> @llvm.sqrt.v2f32(<2 x float>)
78 declare <4 x float> @llvm.sqrt.v4f32(<4 x float>)
79 declare <8 x float> @llvm.sqrt.v8f32(<8 x float>)
80 declare <16 x float> @llvm.sqrt.v16f32(<16 x float>)
81 declare <vscale x 1 x float> @llvm.sqrt.nvx1f32(<vscale x 1 x float>)
82 declare <vscale x 2 x float> @llvm.sqrt.nvx2f32(<vscale x 2 x float>)
83 declare <vscale x 4 x float> @llvm.sqrt.nvx4f32(<vscale x 4 x float>)
84 declare <vscale x 8 x float> @llvm.sqrt.nvx8f32(<vscale x 8 x float>)
85 declare <vscale x 16 x float> @llvm.sqrt.nvx16f32(<vscale x 16 x float>)
86 declare double @llvm.sqrt.f64(double)
87 declare <2 x double> @llvm.sqrt.v2f64(<2 x double>)
88 declare <4 x double> @llvm.sqrt.v4f64(<4 x double>)
89 declare <8 x double> @llvm.sqrt.v8f64(<8 x double>)
90 declare <16 x double> @llvm.sqrt.v16f64(<16 x double>)
91 declare <vscale x 1 x double> @llvm.sqrt.nvx1f64(<vscale x 1 x double>)
92 declare <vscale x 2 x double> @llvm.sqrt.nvx2f64(<vscale x 2 x double>)
93 declare <vscale x 4 x double> @llvm.sqrt.nvx4f64(<vscale x 4 x double>)
94 declare <vscale x 8 x double> @llvm.sqrt.nvx8f64(<vscale x 8 x double>)
98 ; CHECK-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %1 = call float @llvm.pow.f32(float undef, float undef)
99 ; CHECK-NEXT: Cost Model: Found an estimated cost of 23 for instruction: %2 = call <2 x float> @llvm.pow.v2f32(<2 x float> undef, <2 x float> undef)
100 ; CHECK-NEXT: Cost Model: Found an estimated cost of 47 for instruction: %3 = call <4 x float> @llvm.pow.v4f32(<4 x float> undef, <4 x float> undef)
101 ; CHECK-NEXT: Cost Model: Found an estimated cost of 95 for instruction: %4 = call <8 x float> @llvm.pow.v8f32(<8 x float> undef, <8 x float> undef)
102 ; CHECK-NEXT: Cost Model: Found an estimated cost of 191 for instruction: %5 = call <16 x float> @llvm.pow.v16f32(<16 x float> undef, <16 x float> undef)
103 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %6 = call <vscale x 1 x float> @llvm.pow.nxv1f32(<vscale x 1 x float> undef, <vscale x 1 x float> undef)
104 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %7 = call <vscale x 2 x float> @llvm.pow.nxv2f32(<vscale x 2 x float> undef, <vscale x 2 x float> undef)
105 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %8 = call <vscale x 4 x float> @llvm.pow.nxv4f32(<vscale x 4 x float> undef, <vscale x 4 x float> undef)
106 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %9 = call <vscale x 8 x float> @llvm.pow.nxv8f32(<vscale x 8 x float> undef, <vscale x 8 x float> undef)
107 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %10 = call <vscale x 16 x float> @llvm.pow.nxv16f32(<vscale x 16 x float> undef, <vscale x 16 x float> undef)
108 ; CHECK-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %11 = call double @llvm.pow.f64(double undef, double undef)
109 ; CHECK-NEXT: Cost Model: Found an estimated cost of 23 for instruction: %12 = call <2 x double> @llvm.pow.v2f64(<2 x double> undef, <2 x double> undef)
110 ; CHECK-NEXT: Cost Model: Found an estimated cost of 47 for instruction: %13 = call <4 x double> @llvm.pow.v4f64(<4 x double> undef, <4 x double> undef)
111 ; CHECK-NEXT: Cost Model: Found an estimated cost of 95 for instruction: %14 = call <8 x double> @llvm.pow.v8f64(<8 x double> undef, <8 x double> undef)
112 ; CHECK-NEXT: Cost Model: Found an estimated cost of 191 for instruction: %15 = call <16 x double> @llvm.pow.v16f64(<16 x double> undef, <16 x double> undef)
113 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %16 = call <vscale x 1 x double> @llvm.pow.nxv1f64(<vscale x 1 x double> undef, <vscale x 1 x double> undef)
114 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %17 = call <vscale x 2 x double> @llvm.pow.nxv2f64(<vscale x 2 x double> undef, <vscale x 2 x double> undef)
115 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %18 = call <vscale x 4 x double> @llvm.pow.nxv4f64(<vscale x 4 x double> undef, <vscale x 4 x double> undef)
116 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %19 = call <vscale x 8 x double> @llvm.pow.nxv8f64(<vscale x 8 x double> undef, <vscale x 8 x double> undef)
117 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
119 call float @llvm.pow.f32(float undef, float undef)
120 call <2 x float> @llvm.pow.v2f32(<2 x float> undef, <2 x float> undef)
121 call <4 x float> @llvm.pow.v4f32(<4 x float> undef, <4 x float> undef)
122 call <8 x float> @llvm.pow.v8f32(<8 x float> undef, <8 x float> undef)
123 call <16 x float> @llvm.pow.v16f32(<16 x float> undef, <16 x float> undef)
124 call <vscale x 1 x float> @llvm.pow.nvx1f32(<vscale x 1 x float> undef, <vscale x 1 x float> undef)
125 call <vscale x 2 x float> @llvm.pow.nvx2f32(<vscale x 2 x float> undef, <vscale x 2 x float> undef)
126 call <vscale x 4 x float> @llvm.pow.nvx4f32(<vscale x 4 x float> undef, <vscale x 4 x float> undef)
127 call <vscale x 8 x float> @llvm.pow.nvx8f32(<vscale x 8 x float> undef, <vscale x 8 x float> undef)
128 call <vscale x 16 x float> @llvm.pow.nvx16f32(<vscale x 16 x float> undef, <vscale x 16 x float> undef)
129 call double @llvm.pow.f64(double undef, double undef)
130 call <2 x double> @llvm.pow.v2f64(<2 x double> undef, <2 x double> undef)
131 call <4 x double> @llvm.pow.v4f64(<4 x double> undef, <4 x double> undef)
132 call <8 x double> @llvm.pow.v8f64(<8 x double> undef, <8 x double> undef)
133 call <16 x double> @llvm.pow.v16f64(<16 x double> undef, <16 x double> undef)
134 call <vscale x 1 x double> @llvm.pow.nvx1f64(<vscale x 1 x double> undef, <vscale x 1 x double> undef)
135 call <vscale x 2 x double> @llvm.pow.nvx2f64(<vscale x 2 x double> undef, <vscale x 2 x double> undef)
136 call <vscale x 4 x double> @llvm.pow.nvx4f64(<vscale x 4 x double> undef, <vscale x 4 x double> undef)
137 call <vscale x 8 x double> @llvm.pow.nvx8f64(<vscale x 8 x double> undef, <vscale x 8 x double> undef)
141 declare float @llvm.pow.f32(float, float)
142 declare <2 x float> @llvm.pow.v2f32(<2 x float>, <2 x float>)
143 declare <4 x float> @llvm.pow.v4f32(<4 x float>, <4 x float>)
144 declare <8 x float> @llvm.pow.v8f32(<8 x float>, <8 x float>)
145 declare <16 x float> @llvm.pow.v16f32(<16 x float>, <16 x float>)
146 declare <vscale x 1 x float> @llvm.pow.nvx1f32(<vscale x 1 x float>, <vscale x 1 x float>)
147 declare <vscale x 2 x float> @llvm.pow.nvx2f32(<vscale x 2 x float>, <vscale x 2 x float>)
148 declare <vscale x 4 x float> @llvm.pow.nvx4f32(<vscale x 4 x float>, <vscale x 4 x float>)
149 declare <vscale x 8 x float> @llvm.pow.nvx8f32(<vscale x 8 x float>, <vscale x 8 x float>)
150 declare <vscale x 16 x float> @llvm.pow.nvx16f32(<vscale x 16 x float>, <vscale x 16 x float>)
151 declare double @llvm.pow.f64(double, double)
152 declare <2 x double> @llvm.pow.v2f64(<2 x double>, <2 x double>)
153 declare <4 x double> @llvm.pow.v4f64(<4 x double>, <4 x double>)
154 declare <8 x double> @llvm.pow.v8f64(<8 x double>, <8 x double>)
155 declare <16 x double> @llvm.pow.v16f64(<16 x double>, <16 x double>)
156 declare <vscale x 1 x double> @llvm.pow.nvx1f64(<vscale x 1 x double>, <vscale x 1 x double>)
157 declare <vscale x 2 x double> @llvm.pow.nvx2f64(<vscale x 2 x double>, <vscale x 2 x double>)
158 declare <vscale x 4 x double> @llvm.pow.nvx4f64(<vscale x 4 x double>, <vscale x 4 x double>)
159 declare <vscale x 8 x double> @llvm.pow.nvx8f64(<vscale x 8 x double>, <vscale x 8 x double>)