1 ; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
2 ; RUN: opt < %s -cost-model -analyze -mcpu=slm | FileCheck %s --check-prefixes=CHECK,SLM
3 ; RUN: opt < %s -cost-model -analyze -mcpu=goldmont | FileCheck %s --check-prefixes=CHECK,GLM
4 ; RUN: opt < %s -cost-model -analyze -mcpu=goldmont-plus | FileCheck %s --check-prefixes=CHECK,GLM
6 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
7 target triple = "x86_64-unknown-linux-gnu"
9 define <2 x i64> @slm-costs_64_vector_add(<2 x i64> %a, <2 x i64> %b) {
10 ; SLM-LABEL: 'slm-costs_64_vector_add'
11 ; SLM-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res = add <2 x i64> %a, %b
12 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %res
14 ; GLM-LABEL: 'slm-costs_64_vector_add'
15 ; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res = add <2 x i64> %a, %b
16 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %res
19 %res = add <2 x i64> %a, %b
23 define <2 x i64> @slm-costs_64_vector_sub(<2 x i64> %a, <2 x i64> %b) {
24 ; SLM-LABEL: 'slm-costs_64_vector_sub'
25 ; SLM-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res = sub <2 x i64> %a, %b
26 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %res
28 ; GLM-LABEL: 'slm-costs_64_vector_sub'
29 ; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res = sub <2 x i64> %a, %b
30 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %res
33 %res = sub <2 x i64> %a, %b
38 define i8 @slm-costs_8_scalar_mul(i8 %a, i8 %b) {
39 ; CHECK-LABEL: 'slm-costs_8_scalar_mul'
40 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res = mul nsw i8 %a, %b
41 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i8 %res
44 %res = mul nsw i8 %a, %b
48 define <2 x i8> @slm-costs_8_v2_mul(<2 x i8> %a, <2 x i8> %b) {
49 ; SLM-LABEL: 'slm-costs_8_v2_mul'
50 ; SLM-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %res = mul nsw <2 x i8> %a, %b
51 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i8> %res
53 ; GLM-LABEL: 'slm-costs_8_v2_mul'
54 ; GLM-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %res = mul nsw <2 x i8> %a, %b
55 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i8> %res
58 %res = mul nsw <2 x i8> %a, %b
62 define <4 x i8> @slm-costs_8_v4_mul(<4 x i8> %a, <4 x i8> %b) {
63 ; SLM-LABEL: 'slm-costs_8_v4_mul'
64 ; SLM-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %res = mul nsw <4 x i8> %a, %b
65 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i8> %res
67 ; GLM-LABEL: 'slm-costs_8_v4_mul'
68 ; GLM-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %res = mul nsw <4 x i8> %a, %b
69 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i8> %res
72 %res = mul nsw <4 x i8> %a, %b
76 define <4 x i32> @slm-costs_8_v4_zext_mul(<4 x i8> %a) {
77 ; SLM-LABEL: 'slm-costs_8_v4_zext_mul'
78 ; SLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %zext = zext <4 x i8> %a to <4 x i32>
79 ; SLM-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %res = mul nsw <4 x i32> %zext, <i32 255, i32 255, i32 255, i32 255>
80 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res
82 ; GLM-LABEL: 'slm-costs_8_v4_zext_mul'
83 ; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %zext = zext <4 x i8> %a to <4 x i32>
84 ; GLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res = mul nsw <4 x i32> %zext, <i32 255, i32 255, i32 255, i32 255>
85 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res
88 %zext = zext <4 x i8> %a to <4 x i32>
89 %res = mul nsw <4 x i32> %zext, <i32 255, i32 255, i32 255, i32 255>
93 define <4 x i32> @slm-costs_8_v4_zext_mul_fail(<4 x i8> %a) {
94 ; SLM-LABEL: 'slm-costs_8_v4_zext_mul_fail'
95 ; SLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %zext = zext <4 x i8> %a to <4 x i32>
96 ; SLM-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %res = mul nsw <4 x i32> %zext, <i32 255, i32 255, i32 -1, i32 255>
97 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res
99 ; GLM-LABEL: 'slm-costs_8_v4_zext_mul_fail'
100 ; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %zext = zext <4 x i8> %a to <4 x i32>
101 ; GLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res = mul nsw <4 x i32> %zext, <i32 255, i32 255, i32 -1, i32 255>
102 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res
105 %zext = zext <4 x i8> %a to <4 x i32>
106 %res = mul nsw <4 x i32> %zext, <i32 255, i32 255, i32 -1, i32 255>
110 define <4 x i32> @slm-costs_8_v4_zext_mul_fail_2(<4 x i8> %a) {
111 ; SLM-LABEL: 'slm-costs_8_v4_zext_mul_fail_2'
112 ; SLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %zext = zext <4 x i8> %a to <4 x i32>
113 ; SLM-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %res = mul nsw <4 x i32> %zext, <i32 255, i32 256, i32 255, i32 255>
114 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res
116 ; GLM-LABEL: 'slm-costs_8_v4_zext_mul_fail_2'
117 ; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %zext = zext <4 x i8> %a to <4 x i32>
118 ; GLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res = mul nsw <4 x i32> %zext, <i32 255, i32 256, i32 255, i32 255>
119 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res
122 %zext = zext <4 x i8> %a to <4 x i32>
123 %res = mul nsw <4 x i32> %zext, <i32 255, i32 256, i32 255, i32 255>
127 define <4 x i32> @slm-costs_8_v4_sext_mul(<4 x i8> %a) {
128 ; SLM-LABEL: 'slm-costs_8_v4_sext_mul'
129 ; SLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %sext = sext <4 x i8> %a to <4 x i32>
130 ; SLM-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %res = mul nsw <4 x i32> %sext, <i32 127, i32 -128, i32 127, i32 -128>
131 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res
133 ; GLM-LABEL: 'slm-costs_8_v4_sext_mul'
134 ; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %sext = sext <4 x i8> %a to <4 x i32>
135 ; GLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res = mul nsw <4 x i32> %sext, <i32 127, i32 -128, i32 127, i32 -128>
136 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res
139 %sext = sext <4 x i8> %a to <4 x i32>
140 %res = mul nsw <4 x i32> %sext, <i32 127, i32 -128, i32 127, i32 -128>
144 define <4 x i32> @slm-costs_8_v4_sext_mul_fail(<4 x i8> %a) {
145 ; SLM-LABEL: 'slm-costs_8_v4_sext_mul_fail'
146 ; SLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %sext = sext <4 x i8> %a to <4 x i32>
147 ; SLM-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %res = mul nsw <4 x i32> %sext, <i32 127, i32 -128, i32 128, i32 -128>
148 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res
150 ; GLM-LABEL: 'slm-costs_8_v4_sext_mul_fail'
151 ; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %sext = sext <4 x i8> %a to <4 x i32>
152 ; GLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res = mul nsw <4 x i32> %sext, <i32 127, i32 -128, i32 128, i32 -128>
153 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res
156 %sext = sext <4 x i8> %a to <4 x i32>
157 %res = mul nsw <4 x i32> %sext, <i32 127, i32 -128, i32 128, i32 -128>
161 define <4 x i32> @slm-costs_8_v4_sext_mul_fail_2(<4 x i8> %a) {
162 ; SLM-LABEL: 'slm-costs_8_v4_sext_mul_fail_2'
163 ; SLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %sext = sext <4 x i8> %a to <4 x i32>
164 ; SLM-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %res = mul nsw <4 x i32> %sext, <i32 127, i32 -129, i32 127, i32 -128>
165 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res
167 ; GLM-LABEL: 'slm-costs_8_v4_sext_mul_fail_2'
168 ; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %sext = sext <4 x i8> %a to <4 x i32>
169 ; GLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res = mul nsw <4 x i32> %sext, <i32 127, i32 -129, i32 127, i32 -128>
170 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res
173 %sext = sext <4 x i8> %a to <4 x i32>
174 %res = mul nsw <4 x i32> %sext, <i32 127, i32 -129, i32 127, i32 -128>
178 define <8 x i8> @slm-costs_8_v8_mul(<8 x i8> %a, <8 x i8> %b) {
179 ; SLM-LABEL: 'slm-costs_8_v8_mul'
180 ; SLM-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %res = mul nsw <8 x i8> %a, %b
181 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i8> %res
183 ; GLM-LABEL: 'slm-costs_8_v8_mul'
184 ; GLM-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %res = mul nsw <8 x i8> %a, %b
185 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i8> %res
188 %res = mul nsw <8 x i8> %a, %b
192 define <16 x i8> @slm-costs_8_v16_mul(<16 x i8> %a, <16 x i8> %b) {
193 ; SLM-LABEL: 'slm-costs_8_v16_mul'
194 ; SLM-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %res = mul nsw <16 x i8> %a, %b
195 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %res
197 ; GLM-LABEL: 'slm-costs_8_v16_mul'
198 ; GLM-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %res = mul nsw <16 x i8> %a, %b
199 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %res
202 %res = mul nsw <16 x i8> %a, %b
207 define i16 @slm-costs_16_scalar_mul(i16 %a, i16 %b) {
208 ; CHECK-LABEL: 'slm-costs_16_scalar_mul'
209 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res = mul nsw i16 %a, %b
210 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i16 %res
213 %res = mul nsw i16 %a, %b
217 define <2 x i16> @slm-costs_16_v2_mul(<2 x i16> %a, <2 x i16> %b) {
218 ; SLM-LABEL: 'slm-costs_16_v2_mul'
219 ; SLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res = mul nsw <2 x i16> %a, %b
220 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i16> %res
222 ; GLM-LABEL: 'slm-costs_16_v2_mul'
223 ; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res = mul nsw <2 x i16> %a, %b
224 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i16> %res
227 %res = mul nsw <2 x i16> %a, %b
231 define <4 x i16> @slm-costs_16_v4_mul(<4 x i16> %a, <4 x i16> %b) {
232 ; SLM-LABEL: 'slm-costs_16_v4_mul'
233 ; SLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res = mul nsw <4 x i16> %a, %b
234 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i16> %res
236 ; GLM-LABEL: 'slm-costs_16_v4_mul'
237 ; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res = mul nsw <4 x i16> %a, %b
238 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i16> %res
241 %res = mul nsw <4 x i16> %a, %b
245 define <4 x i32> @slm-costs_16_v4_zext_mul(<4 x i16> %a) {
246 ; SLM-LABEL: 'slm-costs_16_v4_zext_mul'
247 ; SLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %zext = zext <4 x i16> %a to <4 x i32>
248 ; SLM-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %res = mul nsw <4 x i32> %zext, <i32 65535, i32 65535, i32 65535, i32 65535>
249 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res
251 ; GLM-LABEL: 'slm-costs_16_v4_zext_mul'
252 ; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %zext = zext <4 x i16> %a to <4 x i32>
253 ; GLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res = mul nsw <4 x i32> %zext, <i32 65535, i32 65535, i32 65535, i32 65535>
254 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res
257 %zext = zext <4 x i16> %a to <4 x i32>
258 %res = mul nsw <4 x i32> %zext, <i32 65535, i32 65535, i32 65535, i32 65535>
262 define <4 x i32> @slm-costs_16_v4_zext_mul_fail(<4 x i16> %a) {
263 ; SLM-LABEL: 'slm-costs_16_v4_zext_mul_fail'
264 ; SLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %zext = zext <4 x i16> %a to <4 x i32>
265 ; SLM-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %res = mul nsw <4 x i32> %zext, <i32 -1, i32 65535, i32 65535, i32 65535>
266 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res
268 ; GLM-LABEL: 'slm-costs_16_v4_zext_mul_fail'
269 ; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %zext = zext <4 x i16> %a to <4 x i32>
270 ; GLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res = mul nsw <4 x i32> %zext, <i32 -1, i32 65535, i32 65535, i32 65535>
271 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res
274 %zext = zext <4 x i16> %a to <4 x i32>
275 %res = mul nsw <4 x i32> %zext, <i32 -1, i32 65535, i32 65535, i32 65535>
279 define <4 x i32> @slm-costs_16_v4_zext_mul_fail_2(<4 x i16> %a) {
280 ; SLM-LABEL: 'slm-costs_16_v4_zext_mul_fail_2'
281 ; SLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %zext = zext <4 x i16> %a to <4 x i32>
282 ; SLM-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %res = mul nsw <4 x i32> %zext, <i32 65536, i32 65535, i32 65535, i32 65535>
283 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res
285 ; GLM-LABEL: 'slm-costs_16_v4_zext_mul_fail_2'
286 ; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %zext = zext <4 x i16> %a to <4 x i32>
287 ; GLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res = mul nsw <4 x i32> %zext, <i32 65536, i32 65535, i32 65535, i32 65535>
288 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res
291 %zext = zext <4 x i16> %a to <4 x i32>
292 %res = mul nsw <4 x i32> %zext, <i32 65536, i32 65535, i32 65535, i32 65535>
296 define <4 x i32> @slm-costs_16_v4_sext_mul(<4 x i16> %a) {
297 ; SLM-LABEL: 'slm-costs_16_v4_sext_mul'
298 ; SLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %sext = sext <4 x i16> %a to <4 x i32>
299 ; SLM-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %res = mul nsw <4 x i32> %sext, <i32 32767, i32 -32768, i32 32767, i32 -32768>
300 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res
302 ; GLM-LABEL: 'slm-costs_16_v4_sext_mul'
303 ; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %sext = sext <4 x i16> %a to <4 x i32>
304 ; GLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res = mul nsw <4 x i32> %sext, <i32 32767, i32 -32768, i32 32767, i32 -32768>
305 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res
308 %sext = sext <4 x i16> %a to <4 x i32>
309 %res = mul nsw <4 x i32> %sext, <i32 32767, i32 -32768, i32 32767, i32 -32768>
313 define <4 x i32> @slm-costs_16_v4_sext_mul_fail(<4 x i16> %a) {
314 ; SLM-LABEL: 'slm-costs_16_v4_sext_mul_fail'
315 ; SLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %sext = sext <4 x i16> %a to <4 x i32>
316 ; SLM-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %res = mul nsw <4 x i32> %sext, <i32 32767, i32 -32768, i32 32768, i32 -32768>
317 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res
319 ; GLM-LABEL: 'slm-costs_16_v4_sext_mul_fail'
320 ; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %sext = sext <4 x i16> %a to <4 x i32>
321 ; GLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res = mul nsw <4 x i32> %sext, <i32 32767, i32 -32768, i32 32768, i32 -32768>
322 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res
325 %sext = sext <4 x i16> %a to <4 x i32>
326 %res = mul nsw <4 x i32> %sext, <i32 32767, i32 -32768, i32 32768, i32 -32768>
330 define <4 x i32> @slm-costs_16_v4_sext_mul_fail_2(<4 x i16> %a) {
331 ; SLM-LABEL: 'slm-costs_16_v4_sext_mul_fail_2'
332 ; SLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %sext = sext <4 x i16> %a to <4 x i32>
333 ; SLM-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %res = mul nsw <4 x i32> %sext, <i32 32767, i32 -32768, i32 32767, i32 -32769>
334 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res
336 ; GLM-LABEL: 'slm-costs_16_v4_sext_mul_fail_2'
337 ; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %sext = sext <4 x i16> %a to <4 x i32>
338 ; GLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res = mul nsw <4 x i32> %sext, <i32 32767, i32 -32768, i32 32767, i32 -32769>
339 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res
342 %sext = sext <4 x i16> %a to <4 x i32>
343 %res = mul nsw <4 x i32> %sext, <i32 32767, i32 -32768, i32 32767, i32 -32769>
347 define <8 x i16> @slm-costs_16_v8_mul(<8 x i16> %a, <8 x i16> %b) {
348 ; SLM-LABEL: 'slm-costs_16_v8_mul'
349 ; SLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res = mul nsw <8 x i16> %a, %b
350 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %res
352 ; GLM-LABEL: 'slm-costs_16_v8_mul'
353 ; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res = mul nsw <8 x i16> %a, %b
354 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %res
357 %res = mul nsw <8 x i16> %a, %b
361 define <16 x i16> @slm-costs_16_v16_mul(<16 x i16> %a, <16 x i16> %b) {
362 ; SLM-LABEL: 'slm-costs_16_v16_mul'
363 ; SLM-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res = mul nsw <16 x i16> %a, %b
364 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %res
366 ; GLM-LABEL: 'slm-costs_16_v16_mul'
367 ; GLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res = mul nsw <16 x i16> %a, %b
368 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %res
371 %res = mul nsw <16 x i16> %a, %b
376 define i32 @slm-costs_32_scalar_mul(i32 %a, i32 %b) {
377 ; CHECK-LABEL: 'slm-costs_32_scalar_mul'
378 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res = mul nsw i32 %a, %b
379 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 %res
382 %res = mul nsw i32 %a, %b
386 define <2 x i32> @slm-costs_32_v2_mul(<2 x i32> %a, <2 x i32> %b) {
387 ; SLM-LABEL: 'slm-costs_32_v2_mul'
388 ; SLM-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %res = mul nsw <2 x i32> %a, %b
389 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i32> %res
391 ; GLM-LABEL: 'slm-costs_32_v2_mul'
392 ; GLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res = mul nsw <2 x i32> %a, %b
393 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i32> %res
396 %res = mul nsw <2 x i32> %a, %b
400 define <4 x i32> @slm-costs_32_v4_mul(<4 x i32> %a, <4 x i32> %b) {
401 ; SLM-LABEL: 'slm-costs_32_v4_mul'
402 ; SLM-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %res = mul nsw <4 x i32> %a, %b
403 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res
405 ; GLM-LABEL: 'slm-costs_32_v4_mul'
406 ; GLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res = mul nsw <4 x i32> %a, %b
407 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res
410 %res = mul nsw <4 x i32> %a, %b
414 define <8 x i32> @slm-costs_32_v8_mul(<8 x i32> %a, <8 x i32> %b) {
415 ; SLM-LABEL: 'slm-costs_32_v8_mul'
416 ; SLM-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %res = mul nsw <8 x i32> %a, %b
417 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %res
419 ; GLM-LABEL: 'slm-costs_32_v8_mul'
420 ; GLM-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res = mul nsw <8 x i32> %a, %b
421 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %res
424 %res = mul nsw <8 x i32> %a, %b
428 define <16 x i32> @slm-costs_32_v16_mul(<16 x i32> %a, <16 x i32> %b) {
429 ; SLM-LABEL: 'slm-costs_32_v16_mul'
430 ; SLM-NEXT: Cost Model: Found an estimated cost of 44 for instruction: %res = mul nsw <16 x i32> %a, %b
431 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %res
433 ; GLM-LABEL: 'slm-costs_32_v16_mul'
434 ; GLM-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %res = mul nsw <16 x i32> %a, %b
435 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %res
438 %res = mul nsw <16 x i32> %a, %b
443 define i64 @slm-costs_64_scalar_mul(i64 %a, i64 %b) {
444 ; CHECK-LABEL: 'slm-costs_64_scalar_mul'
445 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res = mul nsw i64 %a, %b
446 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i64 %res
449 %res = mul nsw i64 %a, %b
453 define <2 x i64> @slm-costs_64_v2_mul(<2 x i64> %a, <2 x i64> %b) {
454 ; SLM-LABEL: 'slm-costs_64_v2_mul'
455 ; SLM-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %res = mul nsw <2 x i64> %a, %b
456 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %res
458 ; GLM-LABEL: 'slm-costs_64_v2_mul'
459 ; GLM-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %res = mul nsw <2 x i64> %a, %b
460 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %res
463 %res = mul nsw <2 x i64> %a, %b
467 define <4 x i64> @slm-costs_64_v4_mul(<4 x i64> %a, <4 x i64> %b) {
468 ; SLM-LABEL: 'slm-costs_64_v4_mul'
469 ; SLM-NEXT: Cost Model: Found an estimated cost of 34 for instruction: %res = mul nsw <4 x i64> %a, %b
470 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %res
472 ; GLM-LABEL: 'slm-costs_64_v4_mul'
473 ; GLM-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %res = mul nsw <4 x i64> %a, %b
474 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %res
477 %res = mul nsw <4 x i64> %a, %b
481 define <8 x i64> @slm-costs_64_v8_mul(<8 x i64> %a, <8 x i64> %b) {
482 ; SLM-LABEL: 'slm-costs_64_v8_mul'
483 ; SLM-NEXT: Cost Model: Found an estimated cost of 68 for instruction: %res = mul nsw <8 x i64> %a, %b
484 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %res
486 ; GLM-LABEL: 'slm-costs_64_v8_mul'
487 ; GLM-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %res = mul nsw <8 x i64> %a, %b
488 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %res
491 %res = mul nsw <8 x i64> %a, %b
495 define <16 x i64> @slm-costs_64_v16_mul(<16 x i64> %a, <16 x i64> %b) {
496 ; SLM-LABEL: 'slm-costs_64_v16_mul'
497 ; SLM-NEXT: Cost Model: Found an estimated cost of 136 for instruction: %res = mul nsw <16 x i64> %a, %b
498 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i64> %res
500 ; GLM-LABEL: 'slm-costs_64_v16_mul'
501 ; GLM-NEXT: Cost Model: Found an estimated cost of 64 for instruction: %res = mul nsw <16 x i64> %a, %b
502 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i64> %res
505 %res = mul nsw <16 x i64> %a, %b
510 define double @slm-costs_mulsd(double %a, double %b) {
511 ; SLM-LABEL: 'slm-costs_mulsd'
512 ; SLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res = fmul double %a, %b
513 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret double %res
515 ; GLM-LABEL: 'slm-costs_mulsd'
516 ; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res = fmul double %a, %b
517 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret double %res
520 %res = fmul double %a, %b
525 define <2 x double> @slm-costs_mulpd(<2 x double> %a, <2 x double> %b) {
526 ; SLM-LABEL: 'slm-costs_mulpd'
527 ; SLM-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res = fmul <2 x double> %a, %b
528 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x double> %res
530 ; GLM-LABEL: 'slm-costs_mulpd'
531 ; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res = fmul <2 x double> %a, %b
532 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x double> %res
535 %res = fmul <2 x double> %a, %b
536 ret <2 x double> %res
540 define <4 x float> @slm-costs_mulps(<4 x float> %a, <4 x float> %b) {
541 ; SLM-LABEL: 'slm-costs_mulps'
542 ; SLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res = fmul <4 x float> %a, %b
543 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x float> %res
545 ; GLM-LABEL: 'slm-costs_mulps'
546 ; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res = fmul <4 x float> %a, %b
547 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x float> %res
550 %res = fmul <4 x float> %a, %b
555 define float @slm-costs_divss(float %a, float %b) {
556 ; SLM-LABEL: 'slm-costs_divss'
557 ; SLM-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %res = fdiv float %a, %b
558 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret float %res
560 ; GLM-LABEL: 'slm-costs_divss'
561 ; GLM-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %res = fdiv float %a, %b
562 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret float %res
565 %res = fdiv float %a, %b
570 define <4 x float> @slm-costs_divps(<4 x float> %a, <4 x float> %b) {
571 ; SLM-LABEL: 'slm-costs_divps'
572 ; SLM-NEXT: Cost Model: Found an estimated cost of 39 for instruction: %res = fdiv <4 x float> %a, %b
573 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x float> %res
575 ; GLM-LABEL: 'slm-costs_divps'
576 ; GLM-NEXT: Cost Model: Found an estimated cost of 35 for instruction: %res = fdiv <4 x float> %a, %b
577 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x float> %res
580 %res = fdiv <4 x float> %a, %b
585 define double @slm-costs_divsd(double %a, double %b) {
586 ; SLM-LABEL: 'slm-costs_divsd'
587 ; SLM-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %res = fdiv double %a, %b
588 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret double %res
590 ; GLM-LABEL: 'slm-costs_divsd'
591 ; GLM-NEXT: Cost Model: Found an estimated cost of 33 for instruction: %res = fdiv double %a, %b
592 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret double %res
595 %res = fdiv double %a, %b
600 define <2 x double> @slm-costs_divpd(<2 x double> %a, <2 x double> %b) {
601 ; SLM-LABEL: 'slm-costs_divpd'
602 ; SLM-NEXT: Cost Model: Found an estimated cost of 69 for instruction: %res = fdiv <2 x double> %a, %b
603 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x double> %res
605 ; GLM-LABEL: 'slm-costs_divpd'
606 ; GLM-NEXT: Cost Model: Found an estimated cost of 65 for instruction: %res = fdiv <2 x double> %a, %b
607 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x double> %res
610 %res = fdiv <2 x double> %a, %b
611 ret <2 x double> %res
615 define <2 x double> @slm-costs_addpd(<2 x double> %a, <2 x double> %b) {
616 ; SLM-LABEL: 'slm-costs_addpd'
617 ; SLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res = fadd <2 x double> %a, %b
618 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x double> %res
620 ; GLM-LABEL: 'slm-costs_addpd'
621 ; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res = fadd <2 x double> %a, %b
622 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x double> %res
625 %res = fadd <2 x double> %a, %b
626 ret <2 x double> %res
630 define <2 x double> @slm-costs_subpd(<2 x double> %a, <2 x double> %b) {
631 ; SLM-LABEL: 'slm-costs_subpd'
632 ; SLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res = fsub <2 x double> %a, %b
633 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x double> %res
635 ; GLM-LABEL: 'slm-costs_subpd'
636 ; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res = fsub <2 x double> %a, %b
637 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x double> %res
640 %res = fsub <2 x double> %a, %b
641 ret <2 x double> %res