1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple aarch64 -O0 -run-pass=aarch64-prelegalizer-combiner -global-isel -verify-machineinstrs %s -o - | FileCheck %s
8 ; CHECK-LABEL: name: test_anyext
9 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
10 ; CHECK: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[COPY]](p0) :: (load (s8))
11 ; CHECK: $w0 = COPY [[LOAD]](s32)
13 %1:_(s8) = G_LOAD %0 :: (load (s8))
14 %2:_(s32) = G_ANYEXT %1
19 name: test_anyext_with_copy
23 ; CHECK-LABEL: name: test_anyext_with_copy
24 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
25 ; CHECK: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[COPY]](p0) :: (load (s8))
26 ; CHECK: $w0 = COPY [[LOAD]](s32)
28 %1:_(s8) = G_LOAD %0 :: (load (s8))
30 %3:_(s32) = G_ANYEXT %1
39 ; CHECK-LABEL: name: test_signext
40 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
41 ; CHECK: [[SEXTLOAD:%[0-9]+]]:_(s32) = G_SEXTLOAD [[COPY]](p0) :: (load (s8))
42 ; CHECK: $w0 = COPY [[SEXTLOAD]](s32)
44 %1:_(s8) = G_LOAD %0 :: (load (s8))
54 ; CHECK-LABEL: name: test_zeroext
55 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
56 ; CHECK: [[ZEXTLOAD:%[0-9]+]]:_(s32) = G_ZEXTLOAD [[COPY]](p0) :: (load (s8))
57 ; CHECK: $w0 = COPY [[ZEXTLOAD]](s32)
59 %1:_(s8) = G_LOAD %0 :: (load (s8))
69 ; CHECK-LABEL: name: test_2anyext
70 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
71 ; CHECK: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[COPY]](p0) :: (load (s8))
72 ; CHECK: $w0 = COPY [[LOAD]](s32)
73 ; CHECK: $w1 = COPY [[LOAD]](s32)
75 %1:_(s8) = G_LOAD %0 :: (load (s8))
76 %2:_(s32) = G_ANYEXT %1
77 %3:_(s32) = G_ANYEXT %1
83 name: test_1anyext_1signext
87 ; CHECK-LABEL: name: test_1anyext_1signext
88 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
89 ; CHECK: [[SEXTLOAD:%[0-9]+]]:_(s32) = G_SEXTLOAD [[COPY]](p0) :: (load (s8))
90 ; CHECK: $w0 = COPY [[SEXTLOAD]](s32)
91 ; CHECK: $w1 = COPY [[SEXTLOAD]](s32)
93 %1:_(s8) = G_LOAD %0 :: (load (s8))
94 %2:_(s32) = G_ANYEXT %1
101 name: test_1xor_1signext
105 ; CHECK-LABEL: name: test_1xor_1signext
106 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
107 ; CHECK: [[SEXTLOAD:%[0-9]+]]:_(s32) = G_SEXTLOAD [[COPY]](p0) :: (load (s8))
108 ; CHECK: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[SEXTLOAD]](s32)
109 ; CHECK: [[C:%[0-9]+]]:_(s8) = G_CONSTANT i8 -1
110 ; CHECK: [[XOR:%[0-9]+]]:_(s8) = G_XOR [[TRUNC]], [[C]]
111 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[XOR]](s8)
112 ; CHECK: $w0 = COPY [[ANYEXT]](s32)
113 ; CHECK: $w1 = COPY [[SEXTLOAD]](s32)
115 %1:_(s8) = G_LOAD %0 :: (load (s8))
116 %2:_(s8) = G_CONSTANT i8 -1
117 %3:_(s8) = G_XOR %1, %2
118 %5:_(s32) = G_ANYEXT %3
119 %6:_(s32) = G_SEXT %1
125 name: test_1anyext_1zeroext
129 ; CHECK-LABEL: name: test_1anyext_1zeroext
130 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
131 ; CHECK: [[ZEXTLOAD:%[0-9]+]]:_(s32) = G_ZEXTLOAD [[COPY]](p0) :: (load (s8))
132 ; CHECK: $w0 = COPY [[ZEXTLOAD]](s32)
133 ; CHECK: $w1 = COPY [[ZEXTLOAD]](s32)
135 %1:_(s8) = G_LOAD %0 :: (load (s8))
136 %2:_(s32) = G_ANYEXT %1
137 %3:_(s32) = G_ZEXT %1
143 name: test_1signext_1zeroext
147 ; CHECK-LABEL: name: test_1signext_1zeroext
148 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
149 ; CHECK: [[SEXTLOAD:%[0-9]+]]:_(s32) = G_SEXTLOAD [[COPY]](p0) :: (load (s8))
150 ; CHECK: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[SEXTLOAD]](s32)
151 ; CHECK: [[ZEXT:%[0-9]+]]:_(s32) = G_ZEXT [[TRUNC]](s8)
152 ; CHECK: $w0 = COPY [[ZEXT]](s32)
153 ; CHECK: $w1 = COPY [[SEXTLOAD]](s32)
155 %1:_(s8) = G_LOAD %0 :: (load (s8))
156 %2:_(s32) = G_ZEXT %1
157 %3:_(s32) = G_SEXT %1
163 name: test_1anyext64_1signext32
167 ; CHECK-LABEL: name: test_1anyext64_1signext32
168 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
169 ; CHECK: [[SEXTLOAD:%[0-9]+]]:_(s32) = G_SEXTLOAD [[COPY]](p0) :: (load (s8))
170 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[SEXTLOAD]](s32)
171 ; CHECK: $x0 = COPY [[ANYEXT]](s64)
172 ; CHECK: $w1 = COPY [[SEXTLOAD]](s32)
174 %1:_(s8) = G_LOAD %0 :: (load (s8))
175 %2:_(s64) = G_ANYEXT %1
176 %3:_(s32) = G_SEXT %1
182 name: test_1anyext32_1signext64
186 ; CHECK-LABEL: name: test_1anyext32_1signext64
187 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
188 ; CHECK: [[SEXTLOAD:%[0-9]+]]:_(s64) = G_SEXTLOAD [[COPY]](p0) :: (load (s8))
189 ; CHECK: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[SEXTLOAD]](s64)
190 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[TRUNC]](s8)
191 ; CHECK: $w0 = COPY [[ANYEXT]](s32)
192 ; CHECK: $x1 = COPY [[SEXTLOAD]](s64)
194 %1:_(s8) = G_LOAD %0 :: (load (s8))
195 %2:_(s32) = G_ANYEXT %1
196 %3:_(s64) = G_SEXT %1
202 name: test_2anyext32_1signext64
206 ; CHECK-LABEL: name: test_2anyext32_1signext64
207 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
208 ; CHECK: [[SEXTLOAD:%[0-9]+]]:_(s64) = G_SEXTLOAD [[COPY]](p0) :: (load (s8))
209 ; CHECK: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[SEXTLOAD]](s64)
210 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[TRUNC]](s8)
211 ; CHECK: [[ANYEXT1:%[0-9]+]]:_(s32) = G_ANYEXT [[TRUNC]](s8)
212 ; CHECK: $w0 = COPY [[ANYEXT]](s32)
213 ; CHECK: $x1 = COPY [[SEXTLOAD]](s64)
214 ; CHECK: $w2 = COPY [[ANYEXT1]](s32)
216 %1:_(s8) = G_LOAD %0 :: (load (s8))
217 %2:_(s32) = G_ANYEXT %1
218 %3:_(s64) = G_SEXT %1
219 %4:_(s32) = G_ANYEXT %1
226 name: test_multiblock_anyext
228 ; CHECK-LABEL: name: test_multiblock_anyext
230 ; CHECK: successors: %bb.1(0x80000000)
231 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
232 ; CHECK: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[COPY]](p0) :: (load (s8))
235 ; CHECK: $w0 = COPY [[LOAD]](s32)
239 %1:_(s8) = G_LOAD %0 :: (load (s8))
242 %2:_(s32) = G_ANYEXT %1
247 name: test_multiblock_signext
249 ; CHECK-LABEL: name: test_multiblock_signext
251 ; CHECK: successors: %bb.1(0x80000000)
252 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
253 ; CHECK: [[SEXTLOAD:%[0-9]+]]:_(s32) = G_SEXTLOAD [[COPY]](p0) :: (load (s8))
256 ; CHECK: $w0 = COPY [[SEXTLOAD]](s32)
260 %1:_(s8) = G_LOAD %0 :: (load (s8))
263 %2:_(s32) = G_SEXT %1
268 name: test_multiblock_zeroext
270 ; CHECK-LABEL: name: test_multiblock_zeroext
272 ; CHECK: successors: %bb.1(0x80000000)
273 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
274 ; CHECK: [[ZEXTLOAD:%[0-9]+]]:_(s32) = G_ZEXTLOAD [[COPY]](p0) :: (load (s8))
277 ; CHECK: $w0 = COPY [[ZEXTLOAD]](s32)
281 %1:_(s8) = G_LOAD %0 :: (load (s8))
284 %2:_(s32) = G_ZEXT %1
289 name: test_multiblock_2anyext
291 ; CHECK-LABEL: name: test_multiblock_2anyext
293 ; CHECK: successors: %bb.1(0x80000000)
294 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
295 ; CHECK: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[COPY]](p0) :: (load (s8))
298 ; CHECK: $w0 = COPY [[LOAD]](s32)
299 ; CHECK: $w1 = COPY [[LOAD]](s32)
303 %1:_(s8) = G_LOAD %0 :: (load (s8))
304 %2:_(s32) = G_ANYEXT %1
307 %3:_(s32) = G_ANYEXT %1
313 name: test_multiblock_1anyext64_1signext32
315 ; CHECK-LABEL: name: test_multiblock_1anyext64_1signext32
317 ; CHECK: successors: %bb.1(0x80000000)
318 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
319 ; CHECK: [[SEXTLOAD:%[0-9]+]]:_(s32) = G_SEXTLOAD [[COPY]](p0) :: (load (s8))
322 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[SEXTLOAD]](s32)
323 ; CHECK: $x0 = COPY [[ANYEXT]](s64)
324 ; CHECK: $w1 = COPY [[SEXTLOAD]](s32)
328 %1:_(s8) = G_LOAD %0 :: (load (s8))
331 %2:_(s64) = G_ANYEXT %1
332 %3:_(s32) = G_SEXT %1
338 name: test_multiblock_1anyext32_1signext64
340 ; CHECK-LABEL: name: test_multiblock_1anyext32_1signext64
342 ; CHECK: successors: %bb.1(0x80000000)
343 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
344 ; CHECK: [[SEXTLOAD:%[0-9]+]]:_(s64) = G_SEXTLOAD [[COPY]](p0) :: (load (s8))
347 ; CHECK: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[SEXTLOAD]](s64)
348 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[TRUNC]](s8)
349 ; CHECK: $w0 = COPY [[ANYEXT]](s32)
350 ; CHECK: $x1 = COPY [[SEXTLOAD]](s64)
354 %1:_(s8) = G_LOAD %0 :: (load (s8))
357 %2:_(s32) = G_ANYEXT %1
358 %3:_(s64) = G_SEXT %1
364 name: test_multiblock_2anyext32_1signext64
366 ; CHECK-LABEL: name: test_multiblock_2anyext32_1signext64
368 ; CHECK: successors: %bb.1(0x80000000)
369 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
370 ; CHECK: [[SEXTLOAD:%[0-9]+]]:_(s64) = G_SEXTLOAD [[COPY]](p0) :: (load (s8))
371 ; CHECK: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[SEXTLOAD]](s64)
372 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[TRUNC]](s8)
375 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s8) = G_TRUNC [[SEXTLOAD]](s64)
376 ; CHECK: [[ANYEXT1:%[0-9]+]]:_(s32) = G_ANYEXT [[TRUNC1]](s8)
377 ; CHECK: $w0 = COPY [[ANYEXT1]](s32)
378 ; CHECK: $x1 = COPY [[SEXTLOAD]](s64)
379 ; CHECK: $w2 = COPY [[ANYEXT]](s32)
383 %1:_(s8) = G_LOAD %0 :: (load (s8))
384 %4:_(s32) = G_ANYEXT %1
387 %2:_(s32) = G_ANYEXT %1
388 %3:_(s64) = G_SEXT %1
396 tracksRegLiveness: true
403 ; CHECK-LABEL: name: test_atomic
404 ; CHECK: liveins: $x0
405 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
406 ; CHECK: [[LOAD:%[0-9]+]]:_(s16) = G_LOAD [[COPY]](p0) :: (load unordered (s16))
407 ; CHECK: [[ZEXT:%[0-9]+]]:_(s32) = G_ZEXT [[LOAD]](s16)
408 ; CHECK: $w0 = COPY [[ZEXT]](s32)
409 ; CHECK: RET_ReallyLR implicit $w0
411 %1:_(s16) = G_LOAD %0(p0) :: (load unordered (s16))
412 %2:_(s32) = G_ZEXT %1(s16)
414 RET_ReallyLR implicit $w0