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 -mcpu=slm | FileCheck %s --check-prefixes=CHECK,SLM
3 ; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output -mcpu=goldmont | FileCheck %s --check-prefixes=CHECK,GLM
4 ; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output -mcpu=goldmont-plus | FileCheck %s --check-prefixes=CHECK,GLM
5 ; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output -mcpu=tremont | FileCheck %s --check-prefixes=CHECK,GLM
7 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
8 target triple = "x86_64-unknown-linux-gnu"
10 define <2 x i64> @slm-costs_64_vector_add(<2 x i64> %a, <2 x i64> %b) {
11 ; SLM-LABEL: 'slm-costs_64_vector_add'
12 ; SLM-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res = add <2 x i64> %a, %b
13 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %res
15 ; GLM-LABEL: 'slm-costs_64_vector_add'
16 ; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res = add <2 x i64> %a, %b
17 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %res
20 %res = add <2 x i64> %a, %b
24 define <2 x i64> @slm-costs_64_vector_sub(<2 x i64> %a, <2 x i64> %b) {
25 ; SLM-LABEL: 'slm-costs_64_vector_sub'
26 ; SLM-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res = sub <2 x i64> %a, %b
27 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %res
29 ; GLM-LABEL: 'slm-costs_64_vector_sub'
30 ; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res = sub <2 x i64> %a, %b
31 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %res
34 %res = sub <2 x i64> %a, %b
39 define i8 @slm-costs_8_scalar_mul(i8 %a, i8 %b) {
40 ; CHECK-LABEL: 'slm-costs_8_scalar_mul'
41 ; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %res = mul nsw i8 %a, %b
42 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i8 %res
45 %res = mul nsw i8 %a, %b
49 define <2 x i8> @slm-costs_8_v2_mul(<2 x i8> %a, <2 x i8> %b) {
50 ; SLM-LABEL: 'slm-costs_8_v2_mul'
51 ; SLM-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %res = mul nsw <2 x i8> %a, %b
52 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i8> %res
54 ; GLM-LABEL: 'slm-costs_8_v2_mul'
55 ; GLM-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res = mul nsw <2 x i8> %a, %b
56 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i8> %res
59 %res = mul nsw <2 x i8> %a, %b
63 define <4 x i8> @slm-costs_8_v4_mul(<4 x i8> %a, <4 x i8> %b) {
64 ; SLM-LABEL: 'slm-costs_8_v4_mul'
65 ; SLM-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %res = mul nsw <4 x i8> %a, %b
66 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i8> %res
68 ; GLM-LABEL: 'slm-costs_8_v4_mul'
69 ; GLM-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res = mul nsw <4 x i8> %a, %b
70 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i8> %res
73 %res = mul nsw <4 x i8> %a, %b
77 define <4 x i32> @slm-costs_8_v4_zext_mul(<4 x i8> %a) {
78 ; SLM-LABEL: 'slm-costs_8_v4_zext_mul'
79 ; SLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %zext = zext <4 x i8> %a to <4 x i32>
80 ; SLM-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>
81 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res
83 ; GLM-LABEL: 'slm-costs_8_v4_zext_mul'
84 ; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %zext = zext <4 x i8> %a to <4 x i32>
85 ; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res = mul nsw <4 x i32> %zext, <i32 255, i32 255, i32 255, i32 255>
86 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res
89 %zext = zext <4 x i8> %a to <4 x i32>
90 %res = mul nsw <4 x i32> %zext, <i32 255, i32 255, i32 255, i32 255>
94 define <4 x i32> @slm-costs_8_v4_zext_mul_fail(<4 x i8> %a) {
95 ; SLM-LABEL: 'slm-costs_8_v4_zext_mul_fail'
96 ; SLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %zext = zext <4 x i8> %a to <4 x i32>
97 ; SLM-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>
98 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res
100 ; GLM-LABEL: 'slm-costs_8_v4_zext_mul_fail'
101 ; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %zext = zext <4 x i8> %a to <4 x i32>
102 ; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res = mul nsw <4 x i32> %zext, <i32 255, i32 255, i32 -1, i32 255>
103 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res
106 %zext = zext <4 x i8> %a to <4 x i32>
107 %res = mul nsw <4 x i32> %zext, <i32 255, i32 255, i32 -1, i32 255>
111 define <4 x i32> @slm-costs_8_v4_zext_mul_fail_2(<4 x i8> %a) {
112 ; SLM-LABEL: 'slm-costs_8_v4_zext_mul_fail_2'
113 ; SLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %zext = zext <4 x i8> %a to <4 x i32>
114 ; SLM-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>
115 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res
117 ; GLM-LABEL: 'slm-costs_8_v4_zext_mul_fail_2'
118 ; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %zext = zext <4 x i8> %a to <4 x i32>
119 ; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res = mul nsw <4 x i32> %zext, <i32 255, i32 256, i32 255, i32 255>
120 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res
123 %zext = zext <4 x i8> %a to <4 x i32>
124 %res = mul nsw <4 x i32> %zext, <i32 255, i32 256, i32 255, i32 255>
128 define <4 x i32> @slm-costs_8_v4_sext_mul(<4 x i8> %a) {
129 ; SLM-LABEL: 'slm-costs_8_v4_sext_mul'
130 ; SLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %sext = sext <4 x i8> %a to <4 x i32>
131 ; SLM-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>
132 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res
134 ; GLM-LABEL: 'slm-costs_8_v4_sext_mul'
135 ; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %sext = sext <4 x i8> %a to <4 x i32>
136 ; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res = mul nsw <4 x i32> %sext, <i32 127, i32 -128, i32 127, i32 -128>
137 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res
140 %sext = sext <4 x i8> %a to <4 x i32>
141 %res = mul nsw <4 x i32> %sext, <i32 127, i32 -128, i32 127, i32 -128>
145 define <4 x i32> @slm-costs_8_v4_sext_mul_fail(<4 x i8> %a) {
146 ; SLM-LABEL: 'slm-costs_8_v4_sext_mul_fail'
147 ; SLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %sext = sext <4 x i8> %a to <4 x i32>
148 ; SLM-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>
149 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res
151 ; GLM-LABEL: 'slm-costs_8_v4_sext_mul_fail'
152 ; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %sext = sext <4 x i8> %a to <4 x i32>
153 ; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res = mul nsw <4 x i32> %sext, <i32 127, i32 -128, i32 128, i32 -128>
154 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res
157 %sext = sext <4 x i8> %a to <4 x i32>
158 %res = mul nsw <4 x i32> %sext, <i32 127, i32 -128, i32 128, i32 -128>
162 define <4 x i32> @slm-costs_8_v4_sext_mul_fail_2(<4 x i8> %a) {
163 ; SLM-LABEL: 'slm-costs_8_v4_sext_mul_fail_2'
164 ; SLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %sext = sext <4 x i8> %a to <4 x i32>
165 ; SLM-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>
166 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res
168 ; GLM-LABEL: 'slm-costs_8_v4_sext_mul_fail_2'
169 ; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %sext = sext <4 x i8> %a to <4 x i32>
170 ; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res = mul nsw <4 x i32> %sext, <i32 127, i32 -129, i32 127, i32 -128>
171 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res
174 %sext = sext <4 x i8> %a to <4 x i32>
175 %res = mul nsw <4 x i32> %sext, <i32 127, i32 -129, i32 127, i32 -128>
179 define <8 x i8> @slm-costs_8_v8_mul(<8 x i8> %a, <8 x i8> %b) {
180 ; SLM-LABEL: 'slm-costs_8_v8_mul'
181 ; SLM-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %res = mul nsw <8 x i8> %a, %b
182 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i8> %res
184 ; GLM-LABEL: 'slm-costs_8_v8_mul'
185 ; GLM-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res = mul nsw <8 x i8> %a, %b
186 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i8> %res
189 %res = mul nsw <8 x i8> %a, %b
193 define <16 x i8> @slm-costs_8_v16_mul(<16 x i8> %a, <16 x i8> %b) {
194 ; CHECK-LABEL: 'slm-costs_8_v16_mul'
195 ; CHECK-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %res = mul nsw <16 x i8> %a, %b
196 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %res
199 %res = mul nsw <16 x i8> %a, %b
204 define i16 @slm-costs_16_scalar_mul(i16 %a, i16 %b) {
205 ; CHECK-LABEL: 'slm-costs_16_scalar_mul'
206 ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res = mul nsw i16 %a, %b
207 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i16 %res
210 %res = mul nsw i16 %a, %b
214 define <2 x i16> @slm-costs_16_v2_mul(<2 x i16> %a, <2 x i16> %b) {
215 ; SLM-LABEL: 'slm-costs_16_v2_mul'
216 ; SLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res = mul nsw <2 x i16> %a, %b
217 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i16> %res
219 ; GLM-LABEL: 'slm-costs_16_v2_mul'
220 ; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res = mul nsw <2 x i16> %a, %b
221 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i16> %res
224 %res = mul nsw <2 x i16> %a, %b
228 define <4 x i16> @slm-costs_16_v4_mul(<4 x i16> %a, <4 x i16> %b) {
229 ; SLM-LABEL: 'slm-costs_16_v4_mul'
230 ; SLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res = mul nsw <4 x i16> %a, %b
231 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i16> %res
233 ; GLM-LABEL: 'slm-costs_16_v4_mul'
234 ; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res = mul nsw <4 x i16> %a, %b
235 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i16> %res
238 %res = mul nsw <4 x i16> %a, %b
242 define <4 x i32> @slm-costs_16_v4_zext_mul(<4 x i16> %a) {
243 ; SLM-LABEL: 'slm-costs_16_v4_zext_mul'
244 ; SLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %zext = zext <4 x i16> %a to <4 x i32>
245 ; 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>
246 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res
248 ; GLM-LABEL: 'slm-costs_16_v4_zext_mul'
249 ; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %zext = zext <4 x i16> %a to <4 x i32>
250 ; 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>
251 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res
254 %zext = zext <4 x i16> %a to <4 x i32>
255 %res = mul nsw <4 x i32> %zext, <i32 65535, i32 65535, i32 65535, i32 65535>
259 define <4 x i32> @slm-costs_16_v4_zext_mul_fail(<4 x i16> %a) {
260 ; SLM-LABEL: 'slm-costs_16_v4_zext_mul_fail'
261 ; SLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %zext = zext <4 x i16> %a to <4 x i32>
262 ; 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>
263 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res
265 ; GLM-LABEL: 'slm-costs_16_v4_zext_mul_fail'
266 ; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %zext = zext <4 x i16> %a to <4 x i32>
267 ; 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>
268 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res
271 %zext = zext <4 x i16> %a to <4 x i32>
272 %res = mul nsw <4 x i32> %zext, <i32 -1, i32 65535, i32 65535, i32 65535>
276 define <4 x i32> @slm-costs_16_v4_zext_mul_fail_2(<4 x i16> %a) {
277 ; SLM-LABEL: 'slm-costs_16_v4_zext_mul_fail_2'
278 ; SLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %zext = zext <4 x i16> %a to <4 x i32>
279 ; 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>
280 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res
282 ; GLM-LABEL: 'slm-costs_16_v4_zext_mul_fail_2'
283 ; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %zext = zext <4 x i16> %a to <4 x i32>
284 ; 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>
285 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res
288 %zext = zext <4 x i16> %a to <4 x i32>
289 %res = mul nsw <4 x i32> %zext, <i32 65536, i32 65535, i32 65535, i32 65535>
293 define <4 x i32> @slm-costs_16_v4_sext_mul(<4 x i16> %a) {
294 ; SLM-LABEL: 'slm-costs_16_v4_sext_mul'
295 ; SLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %sext = sext <4 x i16> %a to <4 x i32>
296 ; SLM-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>
297 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res
299 ; GLM-LABEL: 'slm-costs_16_v4_sext_mul'
300 ; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %sext = sext <4 x i16> %a to <4 x i32>
301 ; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res = mul nsw <4 x i32> %sext, <i32 32767, i32 -32768, i32 32767, i32 -32768>
302 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res
305 %sext = sext <4 x i16> %a to <4 x i32>
306 %res = mul nsw <4 x i32> %sext, <i32 32767, i32 -32768, i32 32767, i32 -32768>
310 define <4 x i32> @slm-costs_16_v4_sext_mul_fail(<4 x i16> %a) {
311 ; SLM-LABEL: 'slm-costs_16_v4_sext_mul_fail'
312 ; SLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %sext = sext <4 x i16> %a to <4 x i32>
313 ; 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>
314 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res
316 ; GLM-LABEL: 'slm-costs_16_v4_sext_mul_fail'
317 ; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %sext = sext <4 x i16> %a to <4 x i32>
318 ; 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>
319 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res
322 %sext = sext <4 x i16> %a to <4 x i32>
323 %res = mul nsw <4 x i32> %sext, <i32 32767, i32 -32768, i32 32768, i32 -32768>
327 define <4 x i32> @slm-costs_16_v4_sext_mul_fail_2(<4 x i16> %a) {
328 ; SLM-LABEL: 'slm-costs_16_v4_sext_mul_fail_2'
329 ; SLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %sext = sext <4 x i16> %a to <4 x i32>
330 ; 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>
331 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res
333 ; GLM-LABEL: 'slm-costs_16_v4_sext_mul_fail_2'
334 ; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %sext = sext <4 x i16> %a to <4 x i32>
335 ; 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>
336 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res
339 %sext = sext <4 x i16> %a to <4 x i32>
340 %res = mul nsw <4 x i32> %sext, <i32 32767, i32 -32768, i32 32767, i32 -32769>
344 define <8 x i16> @slm-costs_16_v8_mul(<8 x i16> %a, <8 x i16> %b) {
345 ; SLM-LABEL: 'slm-costs_16_v8_mul'
346 ; SLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res = mul nsw <8 x i16> %a, %b
347 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %res
349 ; GLM-LABEL: 'slm-costs_16_v8_mul'
350 ; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res = mul nsw <8 x i16> %a, %b
351 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %res
354 %res = mul nsw <8 x i16> %a, %b
358 define <16 x i16> @slm-costs_16_v16_mul(<16 x i16> %a, <16 x i16> %b) {
359 ; SLM-LABEL: 'slm-costs_16_v16_mul'
360 ; SLM-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res = mul nsw <16 x i16> %a, %b
361 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %res
363 ; GLM-LABEL: 'slm-costs_16_v16_mul'
364 ; GLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res = mul nsw <16 x i16> %a, %b
365 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %res
368 %res = mul nsw <16 x i16> %a, %b
373 define i32 @slm-costs_32_scalar_mul(i32 %a, i32 %b) {
374 ; CHECK-LABEL: 'slm-costs_32_scalar_mul'
375 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res = mul nsw i32 %a, %b
376 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 %res
379 %res = mul nsw i32 %a, %b
383 define <2 x i32> @slm-costs_32_v2_mul(<2 x i32> %a, <2 x i32> %b) {
384 ; SLM-LABEL: 'slm-costs_32_v2_mul'
385 ; SLM-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %res = mul nsw <2 x i32> %a, %b
386 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i32> %res
388 ; GLM-LABEL: 'slm-costs_32_v2_mul'
389 ; GLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res = mul nsw <2 x i32> %a, %b
390 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i32> %res
393 %res = mul nsw <2 x i32> %a, %b
397 define <4 x i32> @slm-costs_32_v4_mul(<4 x i32> %a, <4 x i32> %b) {
398 ; SLM-LABEL: 'slm-costs_32_v4_mul'
399 ; SLM-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %res = mul nsw <4 x i32> %a, %b
400 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res
402 ; GLM-LABEL: 'slm-costs_32_v4_mul'
403 ; GLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res = mul nsw <4 x i32> %a, %b
404 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res
407 %res = mul nsw <4 x i32> %a, %b
411 define <8 x i32> @slm-costs_32_v8_mul(<8 x i32> %a, <8 x i32> %b) {
412 ; SLM-LABEL: 'slm-costs_32_v8_mul'
413 ; SLM-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %res = mul nsw <8 x i32> %a, %b
414 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %res
416 ; GLM-LABEL: 'slm-costs_32_v8_mul'
417 ; GLM-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res = mul nsw <8 x i32> %a, %b
418 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %res
421 %res = mul nsw <8 x i32> %a, %b
425 define <16 x i32> @slm-costs_32_v16_mul(<16 x i32> %a, <16 x i32> %b) {
426 ; SLM-LABEL: 'slm-costs_32_v16_mul'
427 ; SLM-NEXT: Cost Model: Found an estimated cost of 44 for instruction: %res = mul nsw <16 x i32> %a, %b
428 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %res
430 ; GLM-LABEL: 'slm-costs_32_v16_mul'
431 ; GLM-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %res = mul nsw <16 x i32> %a, %b
432 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %res
435 %res = mul nsw <16 x i32> %a, %b
440 define i64 @slm-costs_64_scalar_mul(i64 %a, i64 %b) {
441 ; CHECK-LABEL: 'slm-costs_64_scalar_mul'
442 ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res = mul nsw i64 %a, %b
443 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i64 %res
446 %res = mul nsw i64 %a, %b
450 define <2 x i64> @slm-costs_64_v2_mul(<2 x i64> %a, <2 x i64> %b) {
451 ; SLM-LABEL: 'slm-costs_64_v2_mul'
452 ; SLM-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %res = mul nsw <2 x i64> %a, %b
453 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %res
455 ; GLM-LABEL: 'slm-costs_64_v2_mul'
456 ; GLM-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %res = mul nsw <2 x i64> %a, %b
457 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %res
460 %res = mul nsw <2 x i64> %a, %b
464 define <4 x i64> @slm-costs_64_v4_mul(<4 x i64> %a, <4 x i64> %b) {
465 ; SLM-LABEL: 'slm-costs_64_v4_mul'
466 ; SLM-NEXT: Cost Model: Found an estimated cost of 34 for instruction: %res = mul nsw <4 x i64> %a, %b
467 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %res
469 ; GLM-LABEL: 'slm-costs_64_v4_mul'
470 ; GLM-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %res = mul nsw <4 x i64> %a, %b
471 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %res
474 %res = mul nsw <4 x i64> %a, %b
478 define <8 x i64> @slm-costs_64_v8_mul(<8 x i64> %a, <8 x i64> %b) {
479 ; SLM-LABEL: 'slm-costs_64_v8_mul'
480 ; SLM-NEXT: Cost Model: Found an estimated cost of 68 for instruction: %res = mul nsw <8 x i64> %a, %b
481 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %res
483 ; GLM-LABEL: 'slm-costs_64_v8_mul'
484 ; GLM-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %res = mul nsw <8 x i64> %a, %b
485 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %res
488 %res = mul nsw <8 x i64> %a, %b
492 define <16 x i64> @slm-costs_64_v16_mul(<16 x i64> %a, <16 x i64> %b) {
493 ; SLM-LABEL: 'slm-costs_64_v16_mul'
494 ; SLM-NEXT: Cost Model: Found an estimated cost of 136 for instruction: %res = mul nsw <16 x i64> %a, %b
495 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i64> %res
497 ; GLM-LABEL: 'slm-costs_64_v16_mul'
498 ; GLM-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %res = mul nsw <16 x i64> %a, %b
499 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i64> %res
502 %res = mul nsw <16 x i64> %a, %b
507 define double @slm-costs_mulsd(double %a, double %b) {
508 ; SLM-LABEL: 'slm-costs_mulsd'
509 ; SLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res = fmul double %a, %b
510 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret double %res
512 ; GLM-LABEL: 'slm-costs_mulsd'
513 ; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res = fmul double %a, %b
514 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret double %res
517 %res = fmul double %a, %b
522 define <2 x double> @slm-costs_mulpd(<2 x double> %a, <2 x double> %b) {
523 ; SLM-LABEL: 'slm-costs_mulpd'
524 ; SLM-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res = fmul <2 x double> %a, %b
525 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x double> %res
527 ; GLM-LABEL: 'slm-costs_mulpd'
528 ; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res = fmul <2 x double> %a, %b
529 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x double> %res
532 %res = fmul <2 x double> %a, %b
533 ret <2 x double> %res
537 define <4 x float> @slm-costs_mulps(<4 x float> %a, <4 x float> %b) {
538 ; SLM-LABEL: 'slm-costs_mulps'
539 ; SLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res = fmul <4 x float> %a, %b
540 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x float> %res
542 ; GLM-LABEL: 'slm-costs_mulps'
543 ; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res = fmul <4 x float> %a, %b
544 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x float> %res
547 %res = fmul <4 x float> %a, %b
552 define float @slm-costs_divss(float %a, float %b) {
553 ; SLM-LABEL: 'slm-costs_divss'
554 ; SLM-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %res = fdiv float %a, %b
555 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret float %res
557 ; GLM-LABEL: 'slm-costs_divss'
558 ; GLM-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %res = fdiv float %a, %b
559 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret float %res
562 %res = fdiv float %a, %b
567 define <4 x float> @slm-costs_divps(<4 x float> %a, <4 x float> %b) {
568 ; SLM-LABEL: 'slm-costs_divps'
569 ; SLM-NEXT: Cost Model: Found an estimated cost of 39 for instruction: %res = fdiv <4 x float> %a, %b
570 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x float> %res
572 ; GLM-LABEL: 'slm-costs_divps'
573 ; GLM-NEXT: Cost Model: Found an estimated cost of 35 for instruction: %res = fdiv <4 x float> %a, %b
574 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x float> %res
577 %res = fdiv <4 x float> %a, %b
582 define double @slm-costs_divsd(double %a, double %b) {
583 ; SLM-LABEL: 'slm-costs_divsd'
584 ; SLM-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %res = fdiv double %a, %b
585 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret double %res
587 ; GLM-LABEL: 'slm-costs_divsd'
588 ; GLM-NEXT: Cost Model: Found an estimated cost of 33 for instruction: %res = fdiv double %a, %b
589 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret double %res
592 %res = fdiv double %a, %b
597 define <2 x double> @slm-costs_divpd(<2 x double> %a, <2 x double> %b) {
598 ; SLM-LABEL: 'slm-costs_divpd'
599 ; SLM-NEXT: Cost Model: Found an estimated cost of 69 for instruction: %res = fdiv <2 x double> %a, %b
600 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x double> %res
602 ; GLM-LABEL: 'slm-costs_divpd'
603 ; GLM-NEXT: Cost Model: Found an estimated cost of 65 for instruction: %res = fdiv <2 x double> %a, %b
604 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x double> %res
607 %res = fdiv <2 x double> %a, %b
608 ret <2 x double> %res
612 define <2 x double> @slm-costs_addpd(<2 x double> %a, <2 x double> %b) {
613 ; SLM-LABEL: 'slm-costs_addpd'
614 ; SLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res = fadd <2 x double> %a, %b
615 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x double> %res
617 ; GLM-LABEL: 'slm-costs_addpd'
618 ; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res = fadd <2 x double> %a, %b
619 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x double> %res
622 %res = fadd <2 x double> %a, %b
623 ret <2 x double> %res
627 define <2 x double> @slm-costs_subpd(<2 x double> %a, <2 x double> %b) {
628 ; SLM-LABEL: 'slm-costs_subpd'
629 ; SLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res = fsub <2 x double> %a, %b
630 ; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x double> %res
632 ; GLM-LABEL: 'slm-costs_subpd'
633 ; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res = fsub <2 x double> %a, %b
634 ; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x double> %res
637 %res = fsub <2 x double> %a, %b
638 ret <2 x double> %res