1 ; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 2
2 ; Check memory cost model action for fixed vector SVE and Neon
3 ; Vector bits size lower than 256 bits end up assuming Neon cost model
4 ; CHECK-NEON has same performance as CHECK-SVE-128
6 ; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -mtriple=aarch64--linux-gnu -mattr=+neon < %s | FileCheck %s --check-prefix=CHECK-NEON
7 ; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -mtriple=aarch64--linux-gnu -mattr=+sve -aarch64-sve-vector-bits-min=128 < %s | FileCheck %s --check-prefix=CHECK-SVE-128
8 ; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -mtriple=aarch64--linux-gnu -mattr=+sve -aarch64-sve-vector-bits-min=256 < %s | FileCheck %s --check-prefix=CHECK-SVE-256
9 ; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -mtriple=aarch64--linux-gnu -mattr=+sve -aarch64-sve-vector-bits-min=512 < %s | FileCheck %s --check-prefix=CHECK-SVE-512
11 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
13 define <16 x i8> @load16(ptr %ptr) {
14 ; CHECK: function 'load16'
15 ; CHECK-NEON-LABEL: 'load16'
16 ; CHECK-NEON-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %out = load <16 x i8>, ptr %ptr, align 16
17 ; CHECK-NEON-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %out
19 ; CHECK-SVE-128-LABEL: 'load16'
20 ; CHECK-SVE-128-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %out = load <16 x i8>, ptr %ptr, align 16
21 ; CHECK-SVE-128-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %out
23 ; CHECK-SVE-256-LABEL: 'load16'
24 ; CHECK-SVE-256-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %out = load <16 x i8>, ptr %ptr, align 16
25 ; CHECK-SVE-256-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %out
27 ; CHECK-SVE-512-LABEL: 'load16'
28 ; CHECK-SVE-512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %out = load <16 x i8>, ptr %ptr, align 16
29 ; CHECK-SVE-512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %out
31 %out = load <16 x i8>, ptr %ptr
35 define void @store16(ptr %ptr, <16 x i8> %val) {
36 ; CHECK: function 'store16'
37 ; CHECK-NEON-LABEL: 'store16'
38 ; CHECK-NEON-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <16 x i8> %val, ptr %ptr, align 16
39 ; CHECK-NEON-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
41 ; CHECK-SVE-128-LABEL: 'store16'
42 ; CHECK-SVE-128-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <16 x i8> %val, ptr %ptr, align 16
43 ; CHECK-SVE-128-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
45 ; CHECK-SVE-256-LABEL: 'store16'
46 ; CHECK-SVE-256-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <16 x i8> %val, ptr %ptr, align 16
47 ; CHECK-SVE-256-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
49 ; CHECK-SVE-512-LABEL: 'store16'
50 ; CHECK-SVE-512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <16 x i8> %val, ptr %ptr, align 16
51 ; CHECK-SVE-512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
53 store <16 x i8> %val, ptr %ptr
57 define <8 x i8> @load8(ptr %ptr) {
58 ; CHECK: function 'load8'
59 ; CHECK-NEON-LABEL: 'load8'
60 ; CHECK-NEON-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %out = load <8 x i8>, ptr %ptr, align 8
61 ; CHECK-NEON-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i8> %out
63 ; CHECK-SVE-128-LABEL: 'load8'
64 ; CHECK-SVE-128-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %out = load <8 x i8>, ptr %ptr, align 8
65 ; CHECK-SVE-128-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i8> %out
67 ; CHECK-SVE-256-LABEL: 'load8'
68 ; CHECK-SVE-256-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %out = load <8 x i8>, ptr %ptr, align 8
69 ; CHECK-SVE-256-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i8> %out
71 ; CHECK-SVE-512-LABEL: 'load8'
72 ; CHECK-SVE-512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %out = load <8 x i8>, ptr %ptr, align 8
73 ; CHECK-SVE-512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i8> %out
75 %out = load <8 x i8>, ptr %ptr
79 define void @store8(ptr %ptr, <8 x i8> %val) {
80 ; CHECK: function 'store8'
81 ; CHECK-NEON-LABEL: 'store8'
82 ; CHECK-NEON-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <8 x i8> %val, ptr %ptr, align 8
83 ; CHECK-NEON-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
85 ; CHECK-SVE-128-LABEL: 'store8'
86 ; CHECK-SVE-128-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <8 x i8> %val, ptr %ptr, align 8
87 ; CHECK-SVE-128-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
89 ; CHECK-SVE-256-LABEL: 'store8'
90 ; CHECK-SVE-256-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <8 x i8> %val, ptr %ptr, align 8
91 ; CHECK-SVE-256-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
93 ; CHECK-SVE-512-LABEL: 'store8'
94 ; CHECK-SVE-512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <8 x i8> %val, ptr %ptr, align 8
95 ; CHECK-SVE-512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
97 store <8 x i8> %val, ptr %ptr
101 define <4 x i8> @load4(ptr %ptr) {
102 ; CHECK: function 'load4'
103 ; CHECK-NEON-LABEL: 'load4'
104 ; CHECK-NEON-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %out = load <4 x i8>, ptr %ptr, align 4
105 ; CHECK-NEON-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i8> %out
107 ; CHECK-SVE-128-LABEL: 'load4'
108 ; CHECK-SVE-128-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %out = load <4 x i8>, ptr %ptr, align 4
109 ; CHECK-SVE-128-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i8> %out
111 ; CHECK-SVE-256-LABEL: 'load4'
112 ; CHECK-SVE-256-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %out = load <4 x i8>, ptr %ptr, align 4
113 ; CHECK-SVE-256-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i8> %out
115 ; CHECK-SVE-512-LABEL: 'load4'
116 ; CHECK-SVE-512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %out = load <4 x i8>, ptr %ptr, align 4
117 ; CHECK-SVE-512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i8> %out
119 %out = load <4 x i8>, ptr %ptr
123 define void @store4(ptr %ptr, <4 x i8> %val) {
124 ; CHECK: function 'store4'
125 ; CHECK-NEON-LABEL: 'store4'
126 ; CHECK-NEON-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store <4 x i8> %val, ptr %ptr, align 4
127 ; CHECK-NEON-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
129 ; CHECK-SVE-128-LABEL: 'store4'
130 ; CHECK-SVE-128-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store <4 x i8> %val, ptr %ptr, align 4
131 ; CHECK-SVE-128-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
133 ; CHECK-SVE-256-LABEL: 'store4'
134 ; CHECK-SVE-256-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <4 x i8> %val, ptr %ptr, align 4
135 ; CHECK-SVE-256-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
137 ; CHECK-SVE-512-LABEL: 'store4'
138 ; CHECK-SVE-512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <4 x i8> %val, ptr %ptr, align 4
139 ; CHECK-SVE-512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
141 store <4 x i8> %val, ptr %ptr
145 define <16 x i16> @load_256(ptr %ptr) {
146 ; CHECK: function 'load_256'
147 ; CHECK-NEON-LABEL: 'load_256'
148 ; CHECK-NEON-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %out = load <16 x i16>, ptr %ptr, align 32
149 ; CHECK-NEON-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %out
151 ; CHECK-SVE-128-LABEL: 'load_256'
152 ; CHECK-SVE-128-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %out = load <16 x i16>, ptr %ptr, align 32
153 ; CHECK-SVE-128-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %out
155 ; CHECK-SVE-256-LABEL: 'load_256'
156 ; CHECK-SVE-256-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %out = load <16 x i16>, ptr %ptr, align 32
157 ; CHECK-SVE-256-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %out
159 ; CHECK-SVE-512-LABEL: 'load_256'
160 ; CHECK-SVE-512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %out = load <16 x i16>, ptr %ptr, align 32
161 ; CHECK-SVE-512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %out
163 %out = load <16 x i16>, ptr %ptr
167 define <8 x i64> @load_512(ptr %ptr) {
168 ; CHECK: function 'load_512'
169 ; CHECK-NEON-LABEL: 'load_512'
170 ; CHECK-NEON-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %out = load <8 x i64>, ptr %ptr, align 64
171 ; CHECK-NEON-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %out
173 ; CHECK-SVE-128-LABEL: 'load_512'
174 ; CHECK-SVE-128-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %out = load <8 x i64>, ptr %ptr, align 64
175 ; CHECK-SVE-128-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %out
177 ; CHECK-SVE-256-LABEL: 'load_512'
178 ; CHECK-SVE-256-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %out = load <8 x i64>, ptr %ptr, align 64
179 ; CHECK-SVE-256-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %out
181 ; CHECK-SVE-512-LABEL: 'load_512'
182 ; CHECK-SVE-512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %out = load <8 x i64>, ptr %ptr, align 64
183 ; CHECK-SVE-512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %out
185 %out = load <8 x i64>, ptr %ptr
189 declare <4 x i8> @llvm.masked.gather.v4i8.v4p0(<4 x ptr>, i32 immarg, <4 x i1>, <4 x i8>)
190 define <4 x i8> @gather_load_4xi8_constant_mask(<4 x ptr> %ptrs) {
191 ; CHECK: gather_load_4xi8_constant_mask
192 ; CHECK-NEON-LABEL: 'gather_load_4xi8_constant_mask'
193 ; CHECK-NEON-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %lv = call <4 x i8> @llvm.masked.gather.v4i8.v4p0(<4 x ptr> %ptrs, i32 1, <4 x i1> splat (i1 true), <4 x i8> undef)
194 ; CHECK-NEON-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i8> %lv
196 ; CHECK-SVE-128-LABEL: 'gather_load_4xi8_constant_mask'
197 ; CHECK-SVE-128-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %lv = call <4 x i8> @llvm.masked.gather.v4i8.v4p0(<4 x ptr> %ptrs, i32 1, <4 x i1> splat (i1 true), <4 x i8> undef)
198 ; CHECK-SVE-128-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i8> %lv
200 ; CHECK-SVE-256-LABEL: 'gather_load_4xi8_constant_mask'
201 ; CHECK-SVE-256-NEXT: Cost Model: Found an estimated cost of 40 for instruction: %lv = call <4 x i8> @llvm.masked.gather.v4i8.v4p0(<4 x ptr> %ptrs, i32 1, <4 x i1> splat (i1 true), <4 x i8> undef)
202 ; CHECK-SVE-256-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i8> %lv
204 ; CHECK-SVE-512-LABEL: 'gather_load_4xi8_constant_mask'
205 ; CHECK-SVE-512-NEXT: Cost Model: Found an estimated cost of 40 for instruction: %lv = call <4 x i8> @llvm.masked.gather.v4i8.v4p0(<4 x ptr> %ptrs, i32 1, <4 x i1> splat (i1 true), <4 x i8> undef)
206 ; CHECK-SVE-512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i8> %lv
208 %lv = call <4 x i8> @llvm.masked.gather.v4i8.v4p0(<4 x ptr> %ptrs, i32 1, <4 x i1> <i1 true, i1 true, i1 true, i1 true>, <4 x i8> undef)
212 define <4 x i8> @gather_load_4xi8_variable_mask(<4 x ptr> %ptrs, <4 x i1> %cond) {
213 ; CHECK: gather_load_4xi8_variable_mask
214 ; CHECK-NEON-LABEL: 'gather_load_4xi8_variable_mask'
215 ; CHECK-NEON-NEXT: Cost Model: Found an estimated cost of 28 for instruction: %lv = call <4 x i8> @llvm.masked.gather.v4i8.v4p0(<4 x ptr> %ptrs, i32 1, <4 x i1> %cond, <4 x i8> undef)
216 ; CHECK-NEON-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i8> %lv
218 ; CHECK-SVE-128-LABEL: 'gather_load_4xi8_variable_mask'
219 ; CHECK-SVE-128-NEXT: Cost Model: Found an estimated cost of 28 for instruction: %lv = call <4 x i8> @llvm.masked.gather.v4i8.v4p0(<4 x ptr> %ptrs, i32 1, <4 x i1> %cond, <4 x i8> undef)
220 ; CHECK-SVE-128-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i8> %lv
222 ; CHECK-SVE-256-LABEL: 'gather_load_4xi8_variable_mask'
223 ; CHECK-SVE-256-NEXT: Cost Model: Found an estimated cost of 40 for instruction: %lv = call <4 x i8> @llvm.masked.gather.v4i8.v4p0(<4 x ptr> %ptrs, i32 1, <4 x i1> %cond, <4 x i8> undef)
224 ; CHECK-SVE-256-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i8> %lv
226 ; CHECK-SVE-512-LABEL: 'gather_load_4xi8_variable_mask'
227 ; CHECK-SVE-512-NEXT: Cost Model: Found an estimated cost of 40 for instruction: %lv = call <4 x i8> @llvm.masked.gather.v4i8.v4p0(<4 x ptr> %ptrs, i32 1, <4 x i1> %cond, <4 x i8> undef)
228 ; CHECK-SVE-512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i8> %lv
230 %lv = call <4 x i8> @llvm.masked.gather.v4i8.v4p0(<4 x ptr> %ptrs, i32 1, <4 x i1> %cond, <4 x i8> undef)
234 declare void @llvm.masked.scatter.v4i8.v4p0(<4 x i8>, <4 x ptr>, i32 immarg, <4 x i1>)
235 define void @scatter_store_4xi8_constant_mask(<4 x i8> %val, <4 x ptr> %ptrs) {
236 ; CHECK: scatter_store_4xi8_constant_mask
237 ; CHECK-NEON-LABEL: 'scatter_store_4xi8_constant_mask'
238 ; CHECK-NEON-NEXT: Cost Model: Found an estimated cost of 20 for instruction: call void @llvm.masked.scatter.v4i8.v4p0(<4 x i8> %val, <4 x ptr> %ptrs, i32 1, <4 x i1> splat (i1 true))
239 ; CHECK-NEON-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
241 ; CHECK-SVE-128-LABEL: 'scatter_store_4xi8_constant_mask'
242 ; CHECK-SVE-128-NEXT: Cost Model: Found an estimated cost of 20 for instruction: call void @llvm.masked.scatter.v4i8.v4p0(<4 x i8> %val, <4 x ptr> %ptrs, i32 1, <4 x i1> splat (i1 true))
243 ; CHECK-SVE-128-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
245 ; CHECK-SVE-256-LABEL: 'scatter_store_4xi8_constant_mask'
246 ; CHECK-SVE-256-NEXT: Cost Model: Found an estimated cost of 40 for instruction: call void @llvm.masked.scatter.v4i8.v4p0(<4 x i8> %val, <4 x ptr> %ptrs, i32 1, <4 x i1> splat (i1 true))
247 ; CHECK-SVE-256-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
249 ; CHECK-SVE-512-LABEL: 'scatter_store_4xi8_constant_mask'
250 ; CHECK-SVE-512-NEXT: Cost Model: Found an estimated cost of 40 for instruction: call void @llvm.masked.scatter.v4i8.v4p0(<4 x i8> %val, <4 x ptr> %ptrs, i32 1, <4 x i1> splat (i1 true))
251 ; CHECK-SVE-512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
253 call void @llvm.masked.scatter.v4i8.v4p0(<4 x i8> %val, <4 x ptr> %ptrs, i32 1, <4 x i1> <i1 true, i1 true, i1 true, i1 true>)
257 define void @scatter_store_4xi8_variable_mask(<4 x i8> %val, <4 x ptr> %ptrs, <4 x i1> %cond) {
258 ; CHECK: scatter_store_4xi8_variable_mask
259 ; CHECK-NEON-LABEL: 'scatter_store_4xi8_variable_mask'
260 ; CHECK-NEON-NEXT: Cost Model: Found an estimated cost of 28 for instruction: call void @llvm.masked.scatter.v4i8.v4p0(<4 x i8> %val, <4 x ptr> %ptrs, i32 1, <4 x i1> %cond)
261 ; CHECK-NEON-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
263 ; CHECK-SVE-128-LABEL: 'scatter_store_4xi8_variable_mask'
264 ; CHECK-SVE-128-NEXT: Cost Model: Found an estimated cost of 28 for instruction: call void @llvm.masked.scatter.v4i8.v4p0(<4 x i8> %val, <4 x ptr> %ptrs, i32 1, <4 x i1> %cond)
265 ; CHECK-SVE-128-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
267 ; CHECK-SVE-256-LABEL: 'scatter_store_4xi8_variable_mask'
268 ; CHECK-SVE-256-NEXT: Cost Model: Found an estimated cost of 40 for instruction: call void @llvm.masked.scatter.v4i8.v4p0(<4 x i8> %val, <4 x ptr> %ptrs, i32 1, <4 x i1> %cond)
269 ; CHECK-SVE-256-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
271 ; CHECK-SVE-512-LABEL: 'scatter_store_4xi8_variable_mask'
272 ; CHECK-SVE-512-NEXT: Cost Model: Found an estimated cost of 40 for instruction: call void @llvm.masked.scatter.v4i8.v4p0(<4 x i8> %val, <4 x ptr> %ptrs, i32 1, <4 x i1> %cond)
273 ; CHECK-SVE-512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
275 call void @llvm.masked.scatter.v4i8.v4p0(<4 x i8> %val, <4 x ptr> %ptrs, i32 1, <4 x i1> %cond)
279 declare <4 x i32> @llvm.masked.gather.v4i32.v4p0(<4 x ptr>, i32 immarg, <4 x i1>, <4 x i32>)
280 define <4 x i32> @gather_load_4xi32_constant_mask(<4 x ptr> %ptrs) {
281 ; CHECK: gather_load_4xi32_constant_mask
282 ; CHECK-NEON-LABEL: 'gather_load_4xi32_constant_mask'
283 ; CHECK-NEON-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %lv = call <4 x i32> @llvm.masked.gather.v4i32.v4p0(<4 x ptr> %ptrs, i32 1, <4 x i1> splat (i1 true), <4 x i32> undef)
284 ; CHECK-NEON-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %lv
286 ; CHECK-SVE-128-LABEL: 'gather_load_4xi32_constant_mask'
287 ; CHECK-SVE-128-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %lv = call <4 x i32> @llvm.masked.gather.v4i32.v4p0(<4 x ptr> %ptrs, i32 1, <4 x i1> splat (i1 true), <4 x i32> undef)
288 ; CHECK-SVE-128-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %lv
290 ; CHECK-SVE-256-LABEL: 'gather_load_4xi32_constant_mask'
291 ; CHECK-SVE-256-NEXT: Cost Model: Found an estimated cost of 40 for instruction: %lv = call <4 x i32> @llvm.masked.gather.v4i32.v4p0(<4 x ptr> %ptrs, i32 1, <4 x i1> splat (i1 true), <4 x i32> undef)
292 ; CHECK-SVE-256-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %lv
294 ; CHECK-SVE-512-LABEL: 'gather_load_4xi32_constant_mask'
295 ; CHECK-SVE-512-NEXT: Cost Model: Found an estimated cost of 40 for instruction: %lv = call <4 x i32> @llvm.masked.gather.v4i32.v4p0(<4 x ptr> %ptrs, i32 1, <4 x i1> splat (i1 true), <4 x i32> undef)
296 ; CHECK-SVE-512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %lv
298 %lv = call <4 x i32> @llvm.masked.gather.v4i32.v4p0(<4 x ptr> %ptrs, i32 1, <4 x i1> <i1 true, i1 true, i1 true, i1 true>, <4 x i32> undef)
302 define <4 x i32> @gather_load_4xi32_variable_mask(<4 x ptr> %ptrs, <4 x i1> %cond) {
303 ; CHECK: gather_load_4xi32_variable_mask
304 ; CHECK-NEON-LABEL: 'gather_load_4xi32_variable_mask'
305 ; CHECK-NEON-NEXT: Cost Model: Found an estimated cost of 28 for instruction: %lv = call <4 x i32> @llvm.masked.gather.v4i32.v4p0(<4 x ptr> %ptrs, i32 1, <4 x i1> %cond, <4 x i32> undef)
306 ; CHECK-NEON-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %lv
308 ; CHECK-SVE-128-LABEL: 'gather_load_4xi32_variable_mask'
309 ; CHECK-SVE-128-NEXT: Cost Model: Found an estimated cost of 28 for instruction: %lv = call <4 x i32> @llvm.masked.gather.v4i32.v4p0(<4 x ptr> %ptrs, i32 1, <4 x i1> %cond, <4 x i32> undef)
310 ; CHECK-SVE-128-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %lv
312 ; CHECK-SVE-256-LABEL: 'gather_load_4xi32_variable_mask'
313 ; CHECK-SVE-256-NEXT: Cost Model: Found an estimated cost of 40 for instruction: %lv = call <4 x i32> @llvm.masked.gather.v4i32.v4p0(<4 x ptr> %ptrs, i32 1, <4 x i1> %cond, <4 x i32> undef)
314 ; CHECK-SVE-256-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %lv
316 ; CHECK-SVE-512-LABEL: 'gather_load_4xi32_variable_mask'
317 ; CHECK-SVE-512-NEXT: Cost Model: Found an estimated cost of 40 for instruction: %lv = call <4 x i32> @llvm.masked.gather.v4i32.v4p0(<4 x ptr> %ptrs, i32 1, <4 x i1> %cond, <4 x i32> undef)
318 ; CHECK-SVE-512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %lv
320 %lv = call <4 x i32> @llvm.masked.gather.v4i32.v4p0(<4 x ptr> %ptrs, i32 1, <4 x i1> %cond, <4 x i32> undef)
324 declare void @llvm.masked.scatter.v4i32.v4p0(<4 x i32>, <4 x ptr>, i32 immarg, <4 x i1>)
325 define void @scatter_store_4xi32_constant_mask(<4 x i32> %val, <4 x ptr> %ptrs) {
326 ; CHECK: scatter_store_4xi32_constant_mask
327 ; CHECK-NEON-LABEL: 'scatter_store_4xi32_constant_mask'
328 ; CHECK-NEON-NEXT: Cost Model: Found an estimated cost of 20 for instruction: call void @llvm.masked.scatter.v4i32.v4p0(<4 x i32> %val, <4 x ptr> %ptrs, i32 1, <4 x i1> splat (i1 true))
329 ; CHECK-NEON-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
331 ; CHECK-SVE-128-LABEL: 'scatter_store_4xi32_constant_mask'
332 ; CHECK-SVE-128-NEXT: Cost Model: Found an estimated cost of 20 for instruction: call void @llvm.masked.scatter.v4i32.v4p0(<4 x i32> %val, <4 x ptr> %ptrs, i32 1, <4 x i1> splat (i1 true))
333 ; CHECK-SVE-128-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
335 ; CHECK-SVE-256-LABEL: 'scatter_store_4xi32_constant_mask'
336 ; CHECK-SVE-256-NEXT: Cost Model: Found an estimated cost of 40 for instruction: call void @llvm.masked.scatter.v4i32.v4p0(<4 x i32> %val, <4 x ptr> %ptrs, i32 1, <4 x i1> splat (i1 true))
337 ; CHECK-SVE-256-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
339 ; CHECK-SVE-512-LABEL: 'scatter_store_4xi32_constant_mask'
340 ; CHECK-SVE-512-NEXT: Cost Model: Found an estimated cost of 40 for instruction: call void @llvm.masked.scatter.v4i32.v4p0(<4 x i32> %val, <4 x ptr> %ptrs, i32 1, <4 x i1> splat (i1 true))
341 ; CHECK-SVE-512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
343 call void @llvm.masked.scatter.v4i32.v4p0(<4 x i32> %val, <4 x ptr> %ptrs, i32 1, <4 x i1> <i1 true, i1 true, i1 true, i1 true>)
347 define void @scatter_store_4xi32_variable_mask(<4 x i32> %val, <4 x ptr> %ptrs, <4 x i1> %cond) {
348 ; CHECK: scatter_store_4xi32_variable_mask
349 ; CHECK-NEON-LABEL: 'scatter_store_4xi32_variable_mask'
350 ; CHECK-NEON-NEXT: Cost Model: Found an estimated cost of 28 for instruction: call void @llvm.masked.scatter.v4i32.v4p0(<4 x i32> %val, <4 x ptr> %ptrs, i32 1, <4 x i1> %cond)
351 ; CHECK-NEON-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
353 ; CHECK-SVE-128-LABEL: 'scatter_store_4xi32_variable_mask'
354 ; CHECK-SVE-128-NEXT: Cost Model: Found an estimated cost of 28 for instruction: call void @llvm.masked.scatter.v4i32.v4p0(<4 x i32> %val, <4 x ptr> %ptrs, i32 1, <4 x i1> %cond)
355 ; CHECK-SVE-128-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
357 ; CHECK-SVE-256-LABEL: 'scatter_store_4xi32_variable_mask'
358 ; CHECK-SVE-256-NEXT: Cost Model: Found an estimated cost of 40 for instruction: call void @llvm.masked.scatter.v4i32.v4p0(<4 x i32> %val, <4 x ptr> %ptrs, i32 1, <4 x i1> %cond)
359 ; CHECK-SVE-256-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
361 ; CHECK-SVE-512-LABEL: 'scatter_store_4xi32_variable_mask'
362 ; CHECK-SVE-512-NEXT: Cost Model: Found an estimated cost of 40 for instruction: call void @llvm.masked.scatter.v4i32.v4p0(<4 x i32> %val, <4 x ptr> %ptrs, i32 1, <4 x i1> %cond)
363 ; CHECK-SVE-512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
365 call void @llvm.masked.scatter.v4i32.v4p0(<4 x i32> %val, <4 x ptr> %ptrs, i32 1, <4 x i1> %cond)
369 declare <256 x i16> @llvm.masked.gather.v256i16.v256p0(<256 x ptr>, i32, <256 x i1>, <256 x i16>)
370 define void @sve_gather_vls(<256 x i1> %v256i1mask) {
371 ; CHECK-LABEL: 'sve_scatter_vls'
372 ; CHECK-NEON-LABEL: 'sve_gather_vls'
373 ; CHECK-NEON-NEXT: Cost Model: Found an estimated cost of 1792 for instruction: %res.v256i16 = call <256 x i16> @llvm.masked.gather.v256i16.v256p0(<256 x ptr> undef, i32 0, <256 x i1> %v256i1mask, <256 x i16> zeroinitializer)
374 ; CHECK-NEON-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
376 ; CHECK-SVE-128-LABEL: 'sve_gather_vls'
377 ; CHECK-SVE-128-NEXT: Cost Model: Found an estimated cost of 1792 for instruction: %res.v256i16 = call <256 x i16> @llvm.masked.gather.v256i16.v256p0(<256 x ptr> undef, i32 0, <256 x i1> %v256i1mask, <256 x i16> zeroinitializer)
378 ; CHECK-SVE-128-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
380 ; CHECK-SVE-256-LABEL: 'sve_gather_vls'
381 ; CHECK-SVE-256-NEXT: Cost Model: Found an estimated cost of 2560 for instruction: %res.v256i16 = call <256 x i16> @llvm.masked.gather.v256i16.v256p0(<256 x ptr> undef, i32 0, <256 x i1> %v256i1mask, <256 x i16> zeroinitializer)
382 ; CHECK-SVE-256-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
384 ; CHECK-SVE-512-LABEL: 'sve_gather_vls'
385 ; CHECK-SVE-512-NEXT: Cost Model: Found an estimated cost of 2560 for instruction: %res.v256i16 = call <256 x i16> @llvm.masked.gather.v256i16.v256p0(<256 x ptr> undef, i32 0, <256 x i1> %v256i1mask, <256 x i16> zeroinitializer)
386 ; CHECK-SVE-512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
389 %res.v256i16 = call <256 x i16> @llvm.masked.gather.v256i16.v256p0(<256 x ptr> undef, i32 0, <256 x i1> %v256i1mask, <256 x i16> zeroinitializer)
393 declare <256 x float> @llvm.masked.gather.v256f32.v256p0(<256 x ptr>, i32, <256 x i1>, <256 x float>)
394 define void @sve_gather_vls_float(<256 x i1> %v256i1mask) {
395 ; CHECK-LABEL: 'sve_gather_vls_float'
396 ; CHECK-NEON-LABEL: 'sve_gather_vls_float'
397 ; CHECK-NEON-NEXT: Cost Model: Found an estimated cost of 1664 for instruction: %res.v256f32 = call <256 x float> @llvm.masked.gather.v256f32.v256p0(<256 x ptr> undef, i32 0, <256 x i1> %v256i1mask, <256 x float> zeroinitializer)
398 ; CHECK-NEON-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
400 ; CHECK-SVE-128-LABEL: 'sve_gather_vls_float'
401 ; CHECK-SVE-128-NEXT: Cost Model: Found an estimated cost of 1664 for instruction: %res.v256f32 = call <256 x float> @llvm.masked.gather.v256f32.v256p0(<256 x ptr> undef, i32 0, <256 x i1> %v256i1mask, <256 x float> zeroinitializer)
402 ; CHECK-SVE-128-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
404 ; CHECK-SVE-256-LABEL: 'sve_gather_vls_float'
405 ; CHECK-SVE-256-NEXT: Cost Model: Found an estimated cost of 2560 for instruction: %res.v256f32 = call <256 x float> @llvm.masked.gather.v256f32.v256p0(<256 x ptr> undef, i32 0, <256 x i1> %v256i1mask, <256 x float> zeroinitializer)
406 ; CHECK-SVE-256-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
408 ; CHECK-SVE-512-LABEL: 'sve_gather_vls_float'
409 ; CHECK-SVE-512-NEXT: Cost Model: Found an estimated cost of 2560 for instruction: %res.v256f32 = call <256 x float> @llvm.masked.gather.v256f32.v256p0(<256 x ptr> undef, i32 0, <256 x i1> %v256i1mask, <256 x float> zeroinitializer)
410 ; CHECK-SVE-512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
413 %res.v256f32 = call <256 x float> @llvm.masked.gather.v256f32.v256p0(<256 x ptr> undef, i32 0, <256 x i1> %v256i1mask, <256 x float> zeroinitializer)
417 declare void @llvm.masked.scatter.v256i8.v256p0(<256 x i8>, <256 x ptr>, i32, <256 x i1>)
418 define void @sve_scatter_vls(<256 x i1> %v256i1mask){
419 ; CHECK-LABEL: 'sve_scatter_vls'
420 ; CHECK-NEON-LABEL: 'sve_scatter_vls'
421 ; CHECK-NEON-NEXT: Cost Model: Found an estimated cost of 1792 for instruction: call void @llvm.masked.scatter.v256i8.v256p0(<256 x i8> undef, <256 x ptr> undef, i32 0, <256 x i1> %v256i1mask)
422 ; CHECK-NEON-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
424 ; CHECK-SVE-128-LABEL: 'sve_scatter_vls'
425 ; CHECK-SVE-128-NEXT: Cost Model: Found an estimated cost of 1792 for instruction: call void @llvm.masked.scatter.v256i8.v256p0(<256 x i8> undef, <256 x ptr> undef, i32 0, <256 x i1> %v256i1mask)
426 ; CHECK-SVE-128-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
428 ; CHECK-SVE-256-LABEL: 'sve_scatter_vls'
429 ; CHECK-SVE-256-NEXT: Cost Model: Found an estimated cost of 2560 for instruction: call void @llvm.masked.scatter.v256i8.v256p0(<256 x i8> undef, <256 x ptr> undef, i32 0, <256 x i1> %v256i1mask)
430 ; CHECK-SVE-256-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
432 ; CHECK-SVE-512-LABEL: 'sve_scatter_vls'
433 ; CHECK-SVE-512-NEXT: Cost Model: Found an estimated cost of 2560 for instruction: call void @llvm.masked.scatter.v256i8.v256p0(<256 x i8> undef, <256 x ptr> undef, i32 0, <256 x i1> %v256i1mask)
434 ; CHECK-SVE-512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
437 call void @llvm.masked.scatter.v256i8.v256p0(<256 x i8> undef, <256 x ptr> undef, i32 0, <256 x i1> %v256i1mask)
441 declare void @llvm.masked.scatter.v512f16.v512p0(<512 x half>, <512 x ptr>, i32, <512 x i1>)
442 define void @sve_scatter_vls_float(<512 x i1> %v512i1mask){
443 ; CHECK-LABEL: 'sve_scatter_vls_float'
444 ; CHECK-NEON-LABEL: 'sve_scatter_vls_float'
445 ; CHECK-NEON-NEXT: Cost Model: Found an estimated cost of 3456 for instruction: call void @llvm.masked.scatter.v512f16.v512p0(<512 x half> undef, <512 x ptr> undef, i32 0, <512 x i1> %v512i1mask)
446 ; CHECK-NEON-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
448 ; CHECK-SVE-128-LABEL: 'sve_scatter_vls_float'
449 ; CHECK-SVE-128-NEXT: Cost Model: Found an estimated cost of 3456 for instruction: call void @llvm.masked.scatter.v512f16.v512p0(<512 x half> undef, <512 x ptr> undef, i32 0, <512 x i1> %v512i1mask)
450 ; CHECK-SVE-128-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
452 ; CHECK-SVE-256-LABEL: 'sve_scatter_vls_float'
453 ; CHECK-SVE-256-NEXT: Cost Model: Found an estimated cost of 5120 for instruction: call void @llvm.masked.scatter.v512f16.v512p0(<512 x half> undef, <512 x ptr> undef, i32 0, <512 x i1> %v512i1mask)
454 ; CHECK-SVE-256-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
456 ; CHECK-SVE-512-LABEL: 'sve_scatter_vls_float'
457 ; CHECK-SVE-512-NEXT: Cost Model: Found an estimated cost of 5120 for instruction: call void @llvm.masked.scatter.v512f16.v512p0(<512 x half> undef, <512 x ptr> undef, i32 0, <512 x i1> %v512i1mask)
458 ; CHECK-SVE-512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
460 call void @llvm.masked.scatter.v512f16.v512p0(<512 x half> undef, <512 x ptr> undef, i32 0, <512 x i1> %v512i1mask)