1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -o - -mtriple=aarch64-unknown-unknown -run-pass=aarch64-prelegalizer-combiner -verify-machineinstrs %s | FileCheck %s
4 name: test_combine_anyext_trunc
8 ; CHECK-LABEL: name: test_combine_anyext_trunc
11 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
12 ; CHECK-NEXT: $x1 = COPY [[COPY]](s64)
14 %1:_(s32) = G_TRUNC %0(s64)
15 %2:_(s64) = G_ANYEXT %1(s32)
19 name: test_combine_anyext_trunc_with_hint
23 ; CHECK-LABEL: name: test_combine_anyext_trunc_with_hint
26 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
27 ; CHECK-NEXT: $x1 = COPY [[COPY]](s64)
29 %1:_(s32) = G_TRUNC %0(s64)
30 %2:_(s32) = G_ASSERT_ZEXT %1(s32), 11
31 %3:_(s64) = G_ANYEXT %2(s32)
35 name: test_combine_anyext_trunc_vec
39 ; CHECK-LABEL: name: test_combine_anyext_trunc_vec
42 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<2 x s64>) = COPY $q0
43 ; CHECK-NEXT: $q0 = COPY [[COPY]](<2 x s64>)
44 %0:_(<2 x s64>) = COPY $q0
45 %1:_(<2 x s32>) = G_TRUNC %0(<2 x s64>)
46 %2:_(<2 x s64>) = G_ANYEXT %1(<2 x s32>)
47 $q0 = COPY %2(<2 x s64>)
50 name: test_combine_anyext_anyext
54 ; CHECK-LABEL: name: test_combine_anyext_anyext
57 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s16) = COPY $h0
58 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[COPY]](s16)
59 ; CHECK-NEXT: $x0 = COPY [[ANYEXT]](s64)
61 %1:_(s32) = G_ANYEXT %0(s16)
62 %2:_(s64) = G_ANYEXT %1(s32)
66 name: test_combine_anyext_anyext_with_hint
70 ; CHECK-LABEL: name: test_combine_anyext_anyext_with_hint
73 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s16) = COPY $h0
74 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[COPY]](s16)
75 ; CHECK-NEXT: $x0 = COPY [[ANYEXT]](s64)
77 %1:_(s32) = G_ANYEXT %0(s16)
78 %2:_(s32) = G_ASSERT_ZEXT %1(s32), 11
79 %3:_(s64) = G_ANYEXT %2(s32)
83 name: test_combine_anyext_anyext_vec
87 ; CHECK-LABEL: name: test_combine_anyext_anyext_vec
90 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<2 x s16>) = COPY $s0
91 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(<2 x s64>) = G_ANYEXT [[COPY]](<2 x s16>)
92 ; CHECK-NEXT: $q0 = COPY [[ANYEXT]](<2 x s64>)
93 %0:_(<2 x s16>) = COPY $s0
94 %1:_(<2 x s32>) = G_ANYEXT %0(<2 x s16>)
95 %2:_(<2 x s64>) = G_ANYEXT %1(<2 x s32>)
96 $q0 = COPY %2(<2 x s64>)
99 name: test_combine_anyext_sext
103 ; CHECK-LABEL: name: test_combine_anyext_sext
104 ; CHECK: liveins: $h0
106 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s16) = COPY $h0
107 ; CHECK-NEXT: [[SEXT:%[0-9]+]]:_(s64) = G_SEXT [[COPY]](s16)
108 ; CHECK-NEXT: $x0 = COPY [[SEXT]](s64)
110 %1:_(s32) = G_SEXT %0(s16)
111 %2:_(s64) = G_ANYEXT %1(s32)
115 name: test_combine_anyext_sext_with_hint
119 ; CHECK-LABEL: name: test_combine_anyext_sext_with_hint
120 ; CHECK: liveins: $h0
122 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s16) = COPY $h0
123 ; CHECK-NEXT: [[SEXT:%[0-9]+]]:_(s64) = G_SEXT [[COPY]](s16)
124 ; CHECK-NEXT: $x0 = COPY [[SEXT]](s64)
126 %1:_(s32) = G_SEXT %0(s16)
127 %2:_(s32) = G_ASSERT_ZEXT %1(s32), 11
128 %3:_(s64) = G_ANYEXT %2(s32)
132 name: test_combine_anyext_sext_vec
136 ; CHECK-LABEL: name: test_combine_anyext_sext_vec
137 ; CHECK: liveins: $s0
139 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<2 x s16>) = COPY $s0
140 ; CHECK-NEXT: [[SEXT:%[0-9]+]]:_(<2 x s64>) = G_SEXT [[COPY]](<2 x s16>)
141 ; CHECK-NEXT: $q0 = COPY [[SEXT]](<2 x s64>)
142 %0:_(<2 x s16>) = COPY $s0
143 %1:_(<2 x s32>) = G_SEXT %0(<2 x s16>)
144 %2:_(<2 x s64>) = G_ANYEXT %1(<2 x s32>)
145 $q0 = COPY %2(<2 x s64>)
148 name: test_combine_anyext_zext
152 ; CHECK-LABEL: name: test_combine_anyext_zext
153 ; CHECK: liveins: $h0
155 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s16) = COPY $h0
156 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[COPY]](s16)
157 ; CHECK-NEXT: $x0 = COPY [[ZEXT]](s64)
159 %1:_(s32) = G_ZEXT %0(s16)
160 %2:_(s64) = G_ANYEXT %1(s32)
164 name: test_combine_anyext_zext_with_hint
168 ; CHECK-LABEL: name: test_combine_anyext_zext_with_hint
169 ; CHECK: liveins: $h0
171 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s16) = COPY $h0
172 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[COPY]](s16)
173 ; CHECK-NEXT: $x0 = COPY [[ZEXT]](s64)
175 %1:_(s32) = G_ZEXT %0(s16)
176 %2:_(s32) = G_ASSERT_ZEXT %1(s32), 11
177 %3:_(s64) = G_ANYEXT %2(s32)
181 name: test_combine_anyext_zext_vec
185 ; CHECK-LABEL: name: test_combine_anyext_zext_vec
186 ; CHECK: liveins: $s0
188 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<2 x s16>) = COPY $s0
189 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:_(<2 x s64>) = G_ZEXT [[COPY]](<2 x s16>)
190 ; CHECK-NEXT: $q0 = COPY [[ZEXT]](<2 x s64>)
191 %0:_(<2 x s16>) = COPY $s0
192 %1:_(<2 x s32>) = G_ZEXT %0(<2 x s16>)
193 %2:_(<2 x s64>) = G_ANYEXT %1(<2 x s32>)
194 $q0 = COPY %2(<2 x s64>)
197 name: test_combine_sext_sext
201 ; CHECK-LABEL: name: test_combine_sext_sext
202 ; CHECK: liveins: $h0
204 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s16) = COPY $h0
205 ; CHECK-NEXT: [[SEXT:%[0-9]+]]:_(s64) = G_SEXT [[COPY]](s16)
206 ; CHECK-NEXT: $x0 = COPY [[SEXT]](s64)
208 %1:_(s32) = G_SEXT %0(s16)
209 %2:_(s64) = G_SEXT %1(s32)
213 name: test_combine_sext_sext_with_hint
217 ; CHECK-LABEL: name: test_combine_sext_sext_with_hint
218 ; CHECK: liveins: $h0
220 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s16) = COPY $h0
221 ; CHECK-NEXT: [[SEXT:%[0-9]+]]:_(s64) = G_SEXT [[COPY]](s16)
222 ; CHECK-NEXT: $x0 = COPY [[SEXT]](s64)
224 %1:_(s32) = G_SEXT %0(s16)
225 %2:_(s32) = G_ASSERT_SEXT %1(s32), 11
226 %3:_(s64) = G_SEXT %2(s32)
230 name: test_combine_sext_sext_vec
234 ; CHECK-LABEL: name: test_combine_sext_sext_vec
235 ; CHECK: liveins: $s0
237 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<2 x s16>) = COPY $s0
238 ; CHECK-NEXT: [[SEXT:%[0-9]+]]:_(<2 x s64>) = G_SEXT [[COPY]](<2 x s16>)
239 ; CHECK-NEXT: $q0 = COPY [[SEXT]](<2 x s64>)
240 %0:_(<2 x s16>) = COPY $s0
241 %1:_(<2 x s32>) = G_SEXT %0(<2 x s16>)
242 %2:_(<2 x s64>) = G_SEXT %1(<2 x s32>)
243 $q0 = COPY %2(<2 x s64>)
246 name: test_combine_sext_zext
250 ; CHECK-LABEL: name: test_combine_sext_zext
251 ; CHECK: liveins: $h0
253 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s16) = COPY $h0
254 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[COPY]](s16)
255 ; CHECK-NEXT: $x0 = COPY [[ZEXT]](s64)
257 %1:_(s32) = G_ZEXT %0(s16)
258 %2:_(s64) = G_SEXT %1(s32)
262 name: test_combine_sext_zext_with_hint
266 ; CHECK-LABEL: name: test_combine_sext_zext_with_hint
267 ; CHECK: liveins: $h0
269 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s16) = COPY $h0
270 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[COPY]](s16)
271 ; CHECK-NEXT: $x0 = COPY [[ZEXT]](s64)
273 %1:_(s32) = G_ZEXT %0(s16)
274 %2:_(s32) = G_ASSERT_ZEXT %1(s32), 11
275 %3:_(s64) = G_SEXT %2(s32)
279 name: test_combine_sext_zext_vec
283 ; CHECK-LABEL: name: test_combine_sext_zext_vec
284 ; CHECK: liveins: $s0
286 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<2 x s16>) = COPY $s0
287 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:_(<2 x s64>) = G_ZEXT [[COPY]](<2 x s16>)
288 ; CHECK-NEXT: $q0 = COPY [[ZEXT]](<2 x s64>)
289 %0:_(<2 x s16>) = COPY $s0
290 %1:_(<2 x s32>) = G_ZEXT %0(<2 x s16>)
291 %2:_(<2 x s64>) = G_SEXT %1(<2 x s32>)
292 $q0 = COPY %2(<2 x s64>)
295 name: test_combine_zext_zext
299 ; CHECK-LABEL: name: test_combine_zext_zext
300 ; CHECK: liveins: $h0
302 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s16) = COPY $h0
303 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[COPY]](s16)
304 ; CHECK-NEXT: $x0 = COPY [[ZEXT]](s64)
306 %1:_(s32) = G_ZEXT %0(s16)
307 %2:_(s64) = G_ZEXT %1(s32)
311 name: test_combine_zext_zext_with_hint
315 ; CHECK-LABEL: name: test_combine_zext_zext_with_hint
316 ; CHECK: liveins: $h0
318 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s16) = COPY $h0
319 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[COPY]](s16)
320 ; CHECK-NEXT: $x0 = COPY [[ZEXT]](s64)
322 %1:_(s32) = G_ZEXT %0(s16)
323 %2:_(s32) = G_ASSERT_ZEXT %1(s32), 11
324 %3:_(s64) = G_ZEXT %2(s32)
328 name: test_combine_zext_zext_vec
332 ; CHECK-LABEL: name: test_combine_zext_zext_vec
333 ; CHECK: liveins: $s0
335 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<2 x s16>) = COPY $s0
336 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:_(<2 x s64>) = G_ZEXT [[COPY]](<2 x s16>)
337 ; CHECK-NEXT: $q0 = COPY [[ZEXT]](<2 x s64>)
338 %0:_(<2 x s16>) = COPY $s0
339 %1:_(<2 x s32>) = G_ZEXT %0(<2 x s16>)
340 %2:_(<2 x s64>) = G_ZEXT %1(<2 x s32>)
341 $q0 = COPY %2(<2 x s64>)