1 ; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
2 ; RUN: opt < %s -mtriple=x86_64-apple-darwin -passes="print<cost-model>" 2>&1 -disable-output -mattr=+sse2 | FileCheck %s --check-prefixes=CHECK,SSE2
3 ; RUN: opt < %s -mtriple=x86_64-apple-darwin -passes="print<cost-model>" 2>&1 -disable-output -mattr=+sse4.1 | FileCheck %s --check-prefixes=CHECK,SSE41
5 define void @zext_v4i8_to_v4i64(ptr %a) {
6 ; SSE2-LABEL: 'zext_v4i8_to_v4i64'
7 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load <4 x i8>, ptr %a, align 4
8 ; SSE2-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %2 = zext <4 x i8> %1 to <4 x i64>
9 ; SSE2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store <4 x i64> %2, ptr undef, align 4
10 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
12 ; SSE41-LABEL: 'zext_v4i8_to_v4i64'
13 ; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load <4 x i8>, ptr %a, align 4
14 ; SSE41-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %2 = zext <4 x i8> %1 to <4 x i64>
15 ; SSE41-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store <4 x i64> %2, ptr undef, align 4
16 ; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
18 %1 = load <4 x i8>, ptr %a
19 %2 = zext <4 x i8> %1 to <4 x i64>
20 store <4 x i64> %2, ptr undef, align 4
24 define void @sext_v4i8_to_v4i64(ptr %a) {
25 ; SSE2-LABEL: 'sext_v4i8_to_v4i64'
26 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load <4 x i8>, ptr %a, align 4
27 ; SSE2-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %2 = sext <4 x i8> %1 to <4 x i64>
28 ; SSE2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store <4 x i64> %2, ptr undef, align 4
29 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
31 ; SSE41-LABEL: 'sext_v4i8_to_v4i64'
32 ; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load <4 x i8>, ptr %a, align 4
33 ; SSE41-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %2 = sext <4 x i8> %1 to <4 x i64>
34 ; SSE41-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store <4 x i64> %2, ptr undef, align 4
35 ; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
37 %1 = load <4 x i8>, ptr %a
38 %2 = sext <4 x i8> %1 to <4 x i64>
39 store <4 x i64> %2, ptr undef, align 4
43 define void @zext_v4i16_to_v4i64(ptr %a) {
44 ; SSE2-LABEL: 'zext_v4i16_to_v4i64'
45 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load <4 x i16>, ptr %a, align 8
46 ; SSE2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %2 = zext <4 x i16> %1 to <4 x i64>
47 ; SSE2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store <4 x i64> %2, ptr undef, align 4
48 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
50 ; SSE41-LABEL: 'zext_v4i16_to_v4i64'
51 ; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load <4 x i16>, ptr %a, align 8
52 ; SSE41-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %2 = zext <4 x i16> %1 to <4 x i64>
53 ; SSE41-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store <4 x i64> %2, ptr undef, align 4
54 ; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
56 %1 = load <4 x i16>, ptr %a
57 %2 = zext <4 x i16> %1 to <4 x i64>
58 store <4 x i64> %2, ptr undef, align 4
62 define void @sext_v4i16_to_v4i64(ptr %a) {
63 ; SSE2-LABEL: 'sext_v4i16_to_v4i64'
64 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load <4 x i16>, ptr %a, align 8
65 ; SSE2-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %2 = sext <4 x i16> %1 to <4 x i64>
66 ; SSE2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store <4 x i64> %2, ptr undef, align 4
67 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
69 ; SSE41-LABEL: 'sext_v4i16_to_v4i64'
70 ; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load <4 x i16>, ptr %a, align 8
71 ; SSE41-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %2 = sext <4 x i16> %1 to <4 x i64>
72 ; SSE41-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store <4 x i64> %2, ptr undef, align 4
73 ; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
75 %1 = load <4 x i16>, ptr %a
76 %2 = sext <4 x i16> %1 to <4 x i64>
77 store <4 x i64> %2, ptr undef, align 4
82 define void @zext_v4i32_to_v4i64(ptr %a) {
83 ; CHECK-LABEL: 'zext_v4i32_to_v4i64'
84 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load <4 x i32>, ptr %a, align 16
85 ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %2 = zext <4 x i32> %1 to <4 x i64>
86 ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store <4 x i64> %2, ptr undef, align 4
87 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
89 %1 = load <4 x i32>, ptr %a
90 %2 = zext <4 x i32> %1 to <4 x i64>
91 store <4 x i64> %2, ptr undef, align 4
95 define void @sext_v4i32_to_v4i64(ptr %a) {
96 ; SSE2-LABEL: 'sext_v4i32_to_v4i64'
97 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load <4 x i32>, ptr %a, align 16
98 ; SSE2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %2 = sext <4 x i32> %1 to <4 x i64>
99 ; SSE2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store <4 x i64> %2, ptr undef, align 4
100 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
102 ; SSE41-LABEL: 'sext_v4i32_to_v4i64'
103 ; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load <4 x i32>, ptr %a, align 16
104 ; SSE41-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %2 = sext <4 x i32> %1 to <4 x i64>
105 ; SSE41-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store <4 x i64> %2, ptr undef, align 4
106 ; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
108 %1 = load <4 x i32>, ptr %a
109 %2 = sext <4 x i32> %1 to <4 x i64>
110 store <4 x i64> %2, ptr undef, align 4
114 define void @zext_v16i16_to_v16i32(ptr %a) {
115 ; CHECK-LABEL: 'zext_v16i16_to_v16i32'
116 ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %1 = load <16 x i16>, ptr %a, align 32
117 ; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %2 = zext <16 x i16> %1 to <16 x i32>
118 ; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store <16 x i32> %2, ptr undef, align 4
119 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
121 %1 = load <16 x i16>, ptr %a
122 %2 = zext <16 x i16> %1 to <16 x i32>
123 store <16 x i32> %2, ptr undef, align 4
127 define void @sext_v16i16_to_v16i32(ptr %a) {
128 ; SSE2-LABEL: 'sext_v16i16_to_v16i32'
129 ; SSE2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %1 = load <16 x i16>, ptr %a, align 32
130 ; SSE2-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %2 = sext <16 x i16> %1 to <16 x i32>
131 ; SSE2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store <16 x i32> %2, ptr undef, align 4
132 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
134 ; SSE41-LABEL: 'sext_v16i16_to_v16i32'
135 ; SSE41-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %1 = load <16 x i16>, ptr %a, align 32
136 ; SSE41-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %2 = sext <16 x i16> %1 to <16 x i32>
137 ; SSE41-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store <16 x i32> %2, ptr undef, align 4
138 ; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
140 %1 = load <16 x i16>, ptr %a
141 %2 = sext <16 x i16> %1 to <16 x i32>
142 store <16 x i32> %2, ptr undef, align 4
146 define void @zext_v8i16_to_v8i32(ptr %a) {
147 ; CHECK-LABEL: 'zext_v8i16_to_v8i32'
148 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load <8 x i16>, ptr %a, align 16
149 ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %2 = zext <8 x i16> %1 to <8 x i32>
150 ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store <8 x i32> %2, ptr undef, align 4
151 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
153 %1 = load <8 x i16>, ptr %a
154 %2 = zext <8 x i16> %1 to <8 x i32>
155 store <8 x i32> %2, ptr undef, align 4
159 define void @sext_v8i16_to_v8i32(ptr %a) {
160 ; SSE2-LABEL: 'sext_v8i16_to_v8i32'
161 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load <8 x i16>, ptr %a, align 16
162 ; SSE2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %2 = sext <8 x i16> %1 to <8 x i32>
163 ; SSE2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store <8 x i32> %2, ptr undef, align 4
164 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
166 ; SSE41-LABEL: 'sext_v8i16_to_v8i32'
167 ; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load <8 x i16>, ptr %a, align 16
168 ; SSE41-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %2 = sext <8 x i16> %1 to <8 x i32>
169 ; SSE41-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store <8 x i32> %2, ptr undef, align 4
170 ; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
172 %1 = load <8 x i16>, ptr %a
173 %2 = sext <8 x i16> %1 to <8 x i32>
174 store <8 x i32> %2, ptr undef, align 4
178 define void @zext_v4i16_to_v4i32(ptr %a) {
179 ; CHECK-LABEL: 'zext_v4i16_to_v4i32'
180 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load <4 x i16>, ptr %a, align 8
181 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %2 = zext <4 x i16> %1 to <4 x i32>
182 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <4 x i32> %2, ptr undef, align 4
183 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
185 %1 = load <4 x i16>, ptr %a
186 %2 = zext <4 x i16> %1 to <4 x i32>
187 store <4 x i32> %2, ptr undef, align 4
191 define void @sext_v4i16_to_v4i32(ptr %a) {
192 ; SSE2-LABEL: 'sext_v4i16_to_v4i32'
193 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load <4 x i16>, ptr %a, align 8
194 ; SSE2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %2 = sext <4 x i16> %1 to <4 x i32>
195 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <4 x i32> %2, ptr undef, align 4
196 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
198 ; SSE41-LABEL: 'sext_v4i16_to_v4i32'
199 ; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load <4 x i16>, ptr %a, align 8
200 ; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %2 = sext <4 x i16> %1 to <4 x i32>
201 ; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <4 x i32> %2, ptr undef, align 4
202 ; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
204 %1 = load <4 x i16>, ptr %a
205 %2 = sext <4 x i16> %1 to <4 x i32>
206 store <4 x i32> %2, ptr undef, align 4
210 define void @zext_v16i8_to_v16i32(ptr %a) {
211 ; SSE2-LABEL: 'zext_v16i8_to_v16i32'
212 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load <16 x i8>, ptr %a, align 16
213 ; SSE2-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %2 = zext <16 x i8> %1 to <16 x i32>
214 ; SSE2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store <16 x i32> %2, ptr undef, align 4
215 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
217 ; SSE41-LABEL: 'zext_v16i8_to_v16i32'
218 ; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load <16 x i8>, ptr %a, align 16
219 ; SSE41-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %2 = zext <16 x i8> %1 to <16 x i32>
220 ; SSE41-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store <16 x i32> %2, ptr undef, align 4
221 ; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
223 %1 = load <16 x i8>, ptr %a
224 %2 = zext <16 x i8> %1 to <16 x i32>
225 store <16 x i32> %2, ptr undef, align 4
229 define void @sext_v16i8_to_v16i32(ptr %a) {
230 ; SSE2-LABEL: 'sext_v16i8_to_v16i32'
231 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load <16 x i8>, ptr %a, align 16
232 ; SSE2-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %2 = sext <16 x i8> %1 to <16 x i32>
233 ; SSE2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store <16 x i32> %2, ptr undef, align 4
234 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
236 ; SSE41-LABEL: 'sext_v16i8_to_v16i32'
237 ; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load <16 x i8>, ptr %a, align 16
238 ; SSE41-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %2 = sext <16 x i8> %1 to <16 x i32>
239 ; SSE41-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store <16 x i32> %2, ptr undef, align 4
240 ; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
242 %1 = load <16 x i8>, ptr %a
243 %2 = sext <16 x i8> %1 to <16 x i32>
244 store <16 x i32> %2, ptr undef, align 4
248 define void @zext_v8i8_to_v8i32(ptr %a) {
249 ; SSE2-LABEL: 'zext_v8i8_to_v8i32'
250 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load <8 x i8>, ptr %a, align 8
251 ; SSE2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %2 = zext <8 x i8> %1 to <8 x i32>
252 ; SSE2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store <8 x i32> %2, ptr undef, align 4
253 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
255 ; SSE41-LABEL: 'zext_v8i8_to_v8i32'
256 ; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load <8 x i8>, ptr %a, align 8
257 ; SSE41-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %2 = zext <8 x i8> %1 to <8 x i32>
258 ; SSE41-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store <8 x i32> %2, ptr undef, align 4
259 ; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
261 %1 = load <8 x i8>, ptr %a
262 %2 = zext <8 x i8> %1 to <8 x i32>
263 store <8 x i32> %2, ptr undef, align 4
267 define void @sext_v8i8_to_v8i32(ptr %a) {
268 ; SSE2-LABEL: 'sext_v8i8_to_v8i32'
269 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load <8 x i8>, ptr %a, align 8
270 ; SSE2-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %2 = sext <8 x i8> %1 to <8 x i32>
271 ; SSE2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store <8 x i32> %2, ptr undef, align 4
272 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
274 ; SSE41-LABEL: 'sext_v8i8_to_v8i32'
275 ; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load <8 x i8>, ptr %a, align 8
276 ; SSE41-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %2 = sext <8 x i8> %1 to <8 x i32>
277 ; SSE41-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store <8 x i32> %2, ptr undef, align 4
278 ; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
280 %1 = load <8 x i8>, ptr %a
281 %2 = sext <8 x i8> %1 to <8 x i32>
282 store <8 x i32> %2, ptr undef, align 4
286 define void @zext_v4i8_to_v4i32(ptr %a) {
287 ; SSE2-LABEL: 'zext_v4i8_to_v4i32'
288 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load <4 x i8>, ptr %a, align 4
289 ; SSE2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %2 = zext <4 x i8> %1 to <4 x i32>
290 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <4 x i32> %2, ptr undef, align 4
291 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
293 ; SSE41-LABEL: 'zext_v4i8_to_v4i32'
294 ; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load <4 x i8>, ptr %a, align 4
295 ; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %2 = zext <4 x i8> %1 to <4 x i32>
296 ; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <4 x i32> %2, ptr undef, align 4
297 ; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
299 %1 = load <4 x i8>, ptr %a
300 %2 = zext <4 x i8> %1 to <4 x i32>
301 store <4 x i32> %2, ptr undef, align 4
305 define void @sext_v4i8_to_v4i32(ptr %a) {
306 ; SSE2-LABEL: 'sext_v4i8_to_v4i32'
307 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load <4 x i8>, ptr %a, align 4
308 ; SSE2-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %2 = sext <4 x i8> %1 to <4 x i32>
309 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <4 x i32> %2, ptr undef, align 4
310 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
312 ; SSE41-LABEL: 'sext_v4i8_to_v4i32'
313 ; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load <4 x i8>, ptr %a, align 4
314 ; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %2 = sext <4 x i8> %1 to <4 x i32>
315 ; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <4 x i32> %2, ptr undef, align 4
316 ; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
318 %1 = load <4 x i8>, ptr %a
319 %2 = sext <4 x i8> %1 to <4 x i32>
320 store <4 x i32> %2, ptr undef, align 4
324 define void @zext_v16i8_to_v16i16(ptr %a) {
325 ; CHECK-LABEL: 'zext_v16i8_to_v16i16'
326 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load <16 x i8>, ptr %a, align 16
327 ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %2 = zext <16 x i8> %1 to <16 x i16>
328 ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store <16 x i16> %2, ptr undef, align 4
329 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
331 %1 = load <16 x i8>, ptr %a
332 %2 = zext <16 x i8> %1 to <16 x i16>
333 store <16 x i16> %2, ptr undef, align 4
337 define void @sext_v16i8_to_v16i16(ptr %a) {
338 ; SSE2-LABEL: 'sext_v16i8_to_v16i16'
339 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load <16 x i8>, ptr %a, align 16
340 ; SSE2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %2 = sext <16 x i8> %1 to <16 x i16>
341 ; SSE2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store <16 x i16> %2, ptr undef, align 4
342 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
344 ; SSE41-LABEL: 'sext_v16i8_to_v16i16'
345 ; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load <16 x i8>, ptr %a, align 16
346 ; SSE41-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %2 = sext <16 x i8> %1 to <16 x i16>
347 ; SSE41-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store <16 x i16> %2, ptr undef, align 4
348 ; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
350 %1 = load <16 x i8>, ptr %a
351 %2 = sext <16 x i8> %1 to <16 x i16>
352 store <16 x i16> %2, ptr undef, align 4
356 define void @zext_v8i8_to_v8i16(ptr %a) {
357 ; CHECK-LABEL: 'zext_v8i8_to_v8i16'
358 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load <8 x i8>, ptr %a, align 8
359 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %2 = zext <8 x i8> %1 to <8 x i16>
360 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <8 x i16> %2, ptr undef, align 4
361 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
363 %1 = load <8 x i8>, ptr %a
364 %2 = zext <8 x i8> %1 to <8 x i16>
365 store <8 x i16> %2, ptr undef, align 4
369 define void @sext_v8i8_to_v8i16(ptr %a) {
370 ; SSE2-LABEL: 'sext_v8i8_to_v8i16'
371 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load <8 x i8>, ptr %a, align 8
372 ; SSE2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %2 = sext <8 x i8> %1 to <8 x i16>
373 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <8 x i16> %2, ptr undef, align 4
374 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
376 ; SSE41-LABEL: 'sext_v8i8_to_v8i16'
377 ; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load <8 x i8>, ptr %a, align 8
378 ; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %2 = sext <8 x i8> %1 to <8 x i16>
379 ; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <8 x i16> %2, ptr undef, align 4
380 ; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
382 %1 = load <8 x i8>, ptr %a
383 %2 = sext <8 x i8> %1 to <8 x i16>
384 store <8 x i16> %2, ptr undef, align 4
388 define void @zext_v4i8_to_v4i16(ptr %a) {
389 ; CHECK-LABEL: 'zext_v4i8_to_v4i16'
390 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load <4 x i8>, ptr %a, align 4
391 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %2 = zext <4 x i8> %1 to <4 x i16>
392 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <4 x i16> %2, ptr undef, align 4
393 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
395 %1 = load <4 x i8>, ptr %a
396 %2 = zext <4 x i8> %1 to <4 x i16>
397 store <4 x i16> %2, ptr undef, align 4
401 define void @sext_v4i8_to_v4i16(ptr %a) {
402 ; SSE2-LABEL: 'sext_v4i8_to_v4i16'
403 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load <4 x i8>, ptr %a, align 4
404 ; SSE2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %2 = sext <4 x i8> %1 to <4 x i16>
405 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <4 x i16> %2, ptr undef, align 4
406 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
408 ; SSE41-LABEL: 'sext_v4i8_to_v4i16'
409 ; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load <4 x i8>, ptr %a, align 4
410 ; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %2 = sext <4 x i8> %1 to <4 x i16>
411 ; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <4 x i16> %2, ptr undef, align 4
412 ; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
414 %1 = load <4 x i8>, ptr %a
415 %2 = sext <4 x i8> %1 to <4 x i16>
416 store <4 x i16> %2, ptr undef, align 4
420 define void @truncate_v16i32_to_v16i16(ptr %a) {
421 ; CHECK-LABEL: 'truncate_v16i32_to_v16i16'
422 ; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %1 = load <16 x i32>, ptr %a, align 64
423 ; CHECK-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %2 = trunc <16 x i32> %1 to <16 x i16>
424 ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store <16 x i16> %2, ptr undef, align 4
425 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
427 %1 = load <16 x i32>, ptr %a
428 %2 = trunc <16 x i32> %1 to <16 x i16>
429 store <16 x i16> %2, ptr undef, align 4
433 define void @truncate_v8i32_to_v8i16(ptr %a) {
434 ; CHECK-LABEL: 'truncate_v8i32_to_v8i16'
435 ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %1 = load <8 x i32>, ptr %a, align 32
436 ; CHECK-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %2 = trunc <8 x i32> %1 to <8 x i16>
437 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <8 x i16> %2, ptr undef, align 4
438 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
440 %1 = load <8 x i32>, ptr %a
441 %2 = trunc <8 x i32> %1 to <8 x i16>
442 store <8 x i16> %2, ptr undef, align 4
446 define void @truncate_v4i32_to_v4i16(ptr %a) {
447 ; SSE2-LABEL: 'truncate_v4i32_to_v4i16'
448 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load <4 x i32>, ptr %a, align 16
449 ; SSE2-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %2 = trunc <4 x i32> %1 to <4 x i16>
450 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <4 x i16> %2, ptr undef, align 4
451 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
453 ; SSE41-LABEL: 'truncate_v4i32_to_v4i16'
454 ; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load <4 x i32>, ptr %a, align 16
455 ; SSE41-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %2 = trunc <4 x i32> %1 to <4 x i16>
456 ; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <4 x i16> %2, ptr undef, align 4
457 ; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
459 %1 = load <4 x i32>, ptr %a
460 %2 = trunc <4 x i32> %1 to <4 x i16>
461 store <4 x i16> %2, ptr undef, align 4
465 define void @truncate_v16i32_to_v16i8(ptr %a) {
466 ; CHECK-LABEL: 'truncate_v16i32_to_v16i8'
467 ; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %1 = load <16 x i32>, ptr %a, align 64
468 ; CHECK-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %2 = trunc <16 x i32> %1 to <16 x i8>
469 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <16 x i8> %2, ptr undef, align 4
470 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
472 %1 = load <16 x i32>, ptr %a
473 %2 = trunc <16 x i32> %1 to <16 x i8>
474 store <16 x i8> %2, ptr undef, align 4
478 define void @truncate_v8i32_to_v8i8(ptr %a) {
479 ; SSE2-LABEL: 'truncate_v8i32_to_v8i8'
480 ; SSE2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %1 = load <8 x i32>, ptr %a, align 32
481 ; SSE2-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %2 = trunc <8 x i32> %1 to <8 x i8>
482 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <8 x i8> %2, ptr undef, align 4
483 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
485 ; SSE41-LABEL: 'truncate_v8i32_to_v8i8'
486 ; SSE41-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %1 = load <8 x i32>, ptr %a, align 32
487 ; SSE41-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %2 = trunc <8 x i32> %1 to <8 x i8>
488 ; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <8 x i8> %2, ptr undef, align 4
489 ; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
491 %1 = load <8 x i32>, ptr %a
492 %2 = trunc <8 x i32> %1 to <8 x i8>
493 store <8 x i8> %2, ptr undef, align 4
497 define void @truncate_v4i32_to_v4i8(ptr %a) {
498 ; SSE2-LABEL: 'truncate_v4i32_to_v4i8'
499 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load <4 x i32>, ptr %a, align 16
500 ; SSE2-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %2 = trunc <4 x i32> %1 to <4 x i8>
501 ; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <4 x i8> %2, ptr undef, align 4
502 ; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
504 ; SSE41-LABEL: 'truncate_v4i32_to_v4i8'
505 ; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load <4 x i32>, ptr %a, align 16
506 ; SSE41-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %2 = trunc <4 x i32> %1 to <4 x i8>
507 ; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <4 x i8> %2, ptr undef, align 4
508 ; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
510 %1 = load <4 x i32>, ptr %a
511 %2 = trunc <4 x i32> %1 to <4 x i8>
512 store <4 x i8> %2, ptr undef, align 4
516 define void @truncate_v16i16_to_v16i8(ptr %a) {
517 ; CHECK-LABEL: 'truncate_v16i16_to_v16i8'
518 ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %1 = load <16 x i16>, ptr %a, align 32
519 ; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %2 = trunc <16 x i16> %1 to <16 x i8>
520 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <16 x i8> %2, ptr undef, align 4
521 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
523 %1 = load <16 x i16>, ptr %a
524 %2 = trunc <16 x i16> %1 to <16 x i8>
525 store <16 x i8> %2, ptr undef, align 4
529 define void @truncate_v8i16_to_v8i8(ptr %a) {
530 ; CHECK-LABEL: 'truncate_v8i16_to_v8i8'
531 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load <8 x i16>, ptr %a, align 16
532 ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %2 = trunc <8 x i16> %1 to <8 x i8>
533 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <8 x i8> %2, ptr undef, align 4
534 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
536 %1 = load <8 x i16>, ptr %a
537 %2 = trunc <8 x i16> %1 to <8 x i8>
538 store <8 x i8> %2, ptr undef, align 4
542 define void @truncate_v4i16_to_v4i8(ptr %a) {
543 ; CHECK-LABEL: 'truncate_v4i16_to_v4i8'
544 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load <4 x i16>, ptr %a, align 8
545 ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %2 = trunc <4 x i16> %1 to <4 x i8>
546 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <4 x i8> %2, ptr undef, align 4
547 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
549 %1 = load <4 x i16>, ptr %a
550 %2 = trunc <4 x i16> %1 to <4 x i8>
551 store <4 x i8> %2, ptr undef, align 4