1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 2
2 # RUN: llc -mtriple aarch64 -run-pass=aarch64-prelegalizer-combiner -verify-machineinstrs %s -o - | FileCheck %s
5 tracksRegLiveness: true
10 ; CHECK-LABEL: name: add
13 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $s0
14 ; CHECK-NEXT: %cst:_(s32) = G_CONSTANT i32 1
15 ; CHECK-NEXT: %add:_(s32) = G_ADD [[COPY]], %cst
16 ; CHECK-NEXT: $s0 = COPY %add(s32)
17 ; CHECK-NEXT: RET_ReallyLR
19 %cst:_(s32) = G_CONSTANT i32 1
20 %add:_(s32) = G_ADD %cst, %0
27 tracksRegLiveness: true
32 ; CHECK-LABEL: name: mul
35 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $s0
36 ; CHECK-NEXT: %cst:_(s32) = G_CONSTANT i32 3
37 ; CHECK-NEXT: %mul:_(s32) = G_MUL [[COPY]], %cst
38 ; CHECK-NEXT: $s0 = COPY %mul(s32)
39 ; CHECK-NEXT: RET_ReallyLR
41 %cst:_(s32) = G_CONSTANT i32 3
42 %mul:_(s32) = G_MUL %cst, %0
48 tracksRegLiveness: true
53 ; CHECK-LABEL: name: and
56 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $s0
57 ; CHECK-NEXT: %cst:_(s32) = G_CONSTANT i32 5
58 ; CHECK-NEXT: %and:_(s32) = G_AND [[COPY]], %cst
59 ; CHECK-NEXT: $s0 = COPY %and(s32)
60 ; CHECK-NEXT: RET_ReallyLR
62 %cst:_(s32) = G_CONSTANT i32 5
63 %and:_(s32) = G_AND %cst, %0
69 tracksRegLiveness: true
74 ; CHECK-LABEL: name: or
77 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $s0
78 ; CHECK-NEXT: %cst:_(s32) = G_CONSTANT i32 5
79 ; CHECK-NEXT: %or:_(s32) = G_OR [[COPY]], %cst
80 ; CHECK-NEXT: $s0 = COPY %or(s32)
81 ; CHECK-NEXT: RET_ReallyLR
83 %cst:_(s32) = G_CONSTANT i32 5
84 %or:_(s32) = G_OR %cst, %0
90 tracksRegLiveness: true
95 ; CHECK-LABEL: name: xor
98 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $s0
99 ; CHECK-NEXT: %cst:_(s32) = G_CONSTANT i32 5
100 ; CHECK-NEXT: %xor:_(s32) = G_XOR [[COPY]], %cst
101 ; CHECK-NEXT: $s0 = COPY %xor(s32)
102 ; CHECK-NEXT: RET_ReallyLR
104 %cst:_(s32) = G_CONSTANT i32 5
105 %xor:_(s32) = G_XOR %cst, %0
111 tracksRegLiveness: true
116 ; CHECK-LABEL: name: smin
117 ; CHECK: liveins: $s0
119 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $s0
120 ; CHECK-NEXT: %cst:_(s32) = G_CONSTANT i32 10
121 ; CHECK-NEXT: %min:_(s32) = G_SMIN [[COPY]], %cst
122 ; CHECK-NEXT: $s0 = COPY %min(s32)
123 ; CHECK-NEXT: RET_ReallyLR
125 %cst:_(s32) = G_CONSTANT i32 10
126 %min:_(s32) = G_SMIN %cst, %0
132 tracksRegLiveness: true
137 ; CHECK-LABEL: name: smax
138 ; CHECK: liveins: $s0
140 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $s0
141 ; CHECK-NEXT: %cst:_(s32) = G_CONSTANT i32 10
142 ; CHECK-NEXT: %max:_(s32) = G_SMAX [[COPY]], %cst
143 ; CHECK-NEXT: $s0 = COPY %max(s32)
144 ; CHECK-NEXT: RET_ReallyLR
146 %cst:_(s32) = G_CONSTANT i32 10
147 %max:_(s32) = G_SMAX %cst, %0
153 tracksRegLiveness: true
158 ; CHECK-LABEL: name: umin
159 ; CHECK: liveins: $s0
161 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $s0
162 ; CHECK-NEXT: %cst:_(s32) = G_CONSTANT i32 10
163 ; CHECK-NEXT: %min:_(s32) = G_UMIN [[COPY]], %cst
164 ; CHECK-NEXT: $s0 = COPY %min(s32)
165 ; CHECK-NEXT: RET_ReallyLR
167 %cst:_(s32) = G_CONSTANT i32 10
168 %min:_(s32) = G_UMIN %cst, %0
174 tracksRegLiveness: true
179 ; CHECK-LABEL: name: umax
180 ; CHECK: liveins: $s0
182 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $s0
183 ; CHECK-NEXT: %cst:_(s32) = G_CONSTANT i32 10
184 ; CHECK-NEXT: %max:_(s32) = G_UMAX [[COPY]], %cst
185 ; CHECK-NEXT: $s0 = COPY %max(s32)
186 ; CHECK-NEXT: RET_ReallyLR
188 %cst:_(s32) = G_CONSTANT i32 10
189 %max:_(s32) = G_UMAX %cst, %0
195 tracksRegLiveness: true
200 ; CHECK-LABEL: name: uaddo
201 ; CHECK: liveins: $s0
203 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $s0
204 ; CHECK-NEXT: %cst:_(s32) = G_CONSTANT i32 1
205 ; CHECK-NEXT: %add:_(s32), %overflow:_(s1) = G_UADDO [[COPY]], %cst
206 ; CHECK-NEXT: %ret:_(s32) = G_ANYEXT %overflow(s1)
207 ; CHECK-NEXT: $s0 = COPY %ret(s32)
208 ; CHECK-NEXT: RET_ReallyLR
210 %cst:_(s32) = G_CONSTANT i32 1
211 %add:_(s32), %overflow:_(s1) = G_UADDO %cst, %0
212 %ret:_(s32) = G_ANYEXT %overflow
219 tracksRegLiveness: true
224 ; CHECK-LABEL: name: saddo
225 ; CHECK: liveins: $s0
227 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $s0
228 ; CHECK-NEXT: %cst:_(s32) = G_CONSTANT i32 1
229 ; CHECK-NEXT: %add:_(s32), %overflow:_(s1) = G_SADDO [[COPY]], %cst
230 ; CHECK-NEXT: %ret:_(s32) = G_ANYEXT %overflow(s1)
231 ; CHECK-NEXT: $s0 = COPY %ret(s32)
232 ; CHECK-NEXT: RET_ReallyLR
234 %cst:_(s32) = G_CONSTANT i32 1
235 %add:_(s32), %overflow:_(s1) = G_SADDO %cst, %0
236 %ret:_(s32) = G_ANYEXT %overflow
243 tracksRegLiveness: true
248 ; CHECK-LABEL: name: umulo
249 ; CHECK: liveins: $s0
251 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $s0
252 ; CHECK-NEXT: %cst:_(s32) = G_CONSTANT i32 3
253 ; CHECK-NEXT: %mul:_(s32), %overflow:_(s1) = G_UMULO [[COPY]], %cst
254 ; CHECK-NEXT: %ret:_(s32) = G_ANYEXT %overflow(s1)
255 ; CHECK-NEXT: $s0 = COPY %ret(s32)
256 ; CHECK-NEXT: RET_ReallyLR
258 %cst:_(s32) = G_CONSTANT i32 3
259 %mul:_(s32), %overflow:_(s1) = G_UMULO %cst, %0
260 %ret:_(s32) = G_ANYEXT %overflow
266 tracksRegLiveness: true
271 ; CHECK-LABEL: name: smulo
272 ; CHECK: liveins: $s0
274 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $s0
275 ; CHECK-NEXT: %cst:_(s32) = G_CONSTANT i32 3
276 ; CHECK-NEXT: %mul:_(s32), %overflow:_(s1) = G_SMULO [[COPY]], %cst
277 ; CHECK-NEXT: %ret:_(s32) = G_ANYEXT %overflow(s1)
278 ; CHECK-NEXT: $s0 = COPY %ret(s32)
279 ; CHECK-NEXT: RET_ReallyLR
281 %cst:_(s32) = G_CONSTANT i32 3
282 %mul:_(s32), %overflow:_(s1) = G_SMULO %cst, %0
283 %ret:_(s32) = G_ANYEXT %overflow
289 tracksRegLiveness: true
294 ; CHECK-LABEL: name: umulh
295 ; CHECK: liveins: $s0
297 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $s0
298 ; CHECK-NEXT: %cst:_(s32) = G_CONSTANT i32 3
299 ; CHECK-NEXT: %mul:_(s32) = G_UMULH [[COPY]], %cst
300 ; CHECK-NEXT: $s0 = COPY %mul(s32)
301 ; CHECK-NEXT: RET_ReallyLR
303 %cst:_(s32) = G_CONSTANT i32 3
304 %mul:_(s32) = G_UMULH %cst, %0
310 tracksRegLiveness: true
315 ; CHECK-LABEL: name: smulh
316 ; CHECK: liveins: $s0
318 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $s0
319 ; CHECK-NEXT: %cst:_(s32) = G_CONSTANT i32 3
320 ; CHECK-NEXT: %mul:_(s32) = G_UMULH [[COPY]], %cst
321 ; CHECK-NEXT: $s0 = COPY %mul(s32)
322 ; CHECK-NEXT: RET_ReallyLR
324 %cst:_(s32) = G_CONSTANT i32 3
325 %mul:_(s32) = G_UMULH %cst, %0
331 tracksRegLiveness: true
336 ; CHECK-LABEL: name: uaddsat
337 ; CHECK: liveins: $s0
339 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $s0
340 ; CHECK-NEXT: %cst:_(s32) = G_CONSTANT i32 1
341 ; CHECK-NEXT: %add:_(s32) = G_UADDSAT [[COPY]], %cst
342 ; CHECK-NEXT: $s0 = COPY %add(s32)
343 ; CHECK-NEXT: RET_ReallyLR
345 %cst:_(s32) = G_CONSTANT i32 1
346 %add:_(s32) = G_UADDSAT %cst, %0
353 tracksRegLiveness: true
358 ; CHECK-LABEL: name: saddsat
359 ; CHECK: liveins: $s0
361 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $s0
362 ; CHECK-NEXT: %cst:_(s32) = G_CONSTANT i32 1
363 ; CHECK-NEXT: %add:_(s32) = G_SADDSAT [[COPY]], %cst
364 ; CHECK-NEXT: $s0 = COPY %add(s32)
365 ; CHECK-NEXT: RET_ReallyLR
367 %cst:_(s32) = G_CONSTANT i32 1
368 %add:_(s32) = G_SADDSAT %cst, %0
375 tracksRegLiveness: true
380 ; CHECK-LABEL: name: smulfix
381 ; CHECK: liveins: $s0
383 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $s0
384 ; CHECK-NEXT: %cst:_(s32) = G_CONSTANT i32 3
385 ; CHECK-NEXT: %mul:_(s32) = G_SMULFIX [[COPY]], %cst, 7
386 ; CHECK-NEXT: $s0 = COPY %mul(s32)
387 ; CHECK-NEXT: RET_ReallyLR
389 %cst:_(s32) = G_CONSTANT i32 3
390 %mul:_(s32) = G_SMULFIX %cst, %0, 7
396 tracksRegLiveness: true
401 ; CHECK-LABEL: name: umulfix
402 ; CHECK: liveins: $s0
404 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $s0
405 ; CHECK-NEXT: %cst:_(s32) = G_CONSTANT i32 3
406 ; CHECK-NEXT: %mul:_(s32) = G_UMULFIX [[COPY]], %cst, 7
407 ; CHECK-NEXT: $s0 = COPY %mul(s32)
408 ; CHECK-NEXT: RET_ReallyLR
410 %cst:_(s32) = G_CONSTANT i32 3
411 %mul:_(s32) = G_UMULFIX %cst, %0, 7
417 tracksRegLiveness: true
422 ; CHECK-LABEL: name: smulfixsat
423 ; CHECK: liveins: $s0
425 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $s0
426 ; CHECK-NEXT: %cst:_(s32) = G_CONSTANT i32 3
427 ; CHECK-NEXT: %mul:_(s32) = G_SMULFIXSAT [[COPY]], %cst, 7
428 ; CHECK-NEXT: $s0 = COPY %mul(s32)
429 ; CHECK-NEXT: RET_ReallyLR
431 %cst:_(s32) = G_CONSTANT i32 3
432 %mul:_(s32) = G_SMULFIXSAT %cst, %0, 7
438 tracksRegLiveness: true
443 ; CHECK-LABEL: name: umulfixsat
444 ; CHECK: liveins: $s0
446 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $s0
447 ; CHECK-NEXT: %cst:_(s32) = G_CONSTANT i32 3
448 ; CHECK-NEXT: %mul:_(s32) = G_UMULFIXSAT [[COPY]], %cst, 7
449 ; CHECK-NEXT: $s0 = COPY %mul(s32)
450 ; CHECK-NEXT: RET_ReallyLR
452 %cst:_(s32) = G_CONSTANT i32 3
453 %mul:_(s32) = G_UMULFIXSAT %cst, %0, 7