1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2# RUN: llc %s -run-pass legalizer -march=arm64 -global-isel=1 -verify-machineinstrs -o - | FileCheck %s
3
4...
5---
6name:            legalize-uaddo
7alignment:       4
8tracksRegLiveness: true
9body:             |
10  bb.1:
11    liveins: $x0
12
13    ; CHECK-LABEL: name: legalize-uaddo
14    ; CHECK: liveins: $x0
15    ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
16    ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
17    ; CHECK: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64)
18    ; CHECK: [[AND:%[0-9]+]]:_(s32) = G_AND [[TRUNC]], [[C]]
19    ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 2
20    ; CHECK: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[AND]], [[C1]]
21    ; CHECK: [[AND1:%[0-9]+]]:_(s32) = G_AND [[ADD]], [[C]]
22    ; CHECK: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ne), [[ADD]](s32), [[AND1]]
23    ; CHECK: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
24    ; CHECK: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[ICMP]](s32)
25    ; CHECK: [[AND2:%[0-9]+]]:_(s64) = G_AND [[ANYEXT]], [[C2]]
26    ; CHECK: $x0 = COPY [[AND2]](s64)
27    ; CHECK: RET_ReallyLR implicit $x0
28    %0:_(s64) = COPY $x0
29    %4:_(s16) = G_CONSTANT i16 2
30    %1:_(s16) = G_TRUNC %0(s64)
31    %2:_(s16), %3:_(s1) = G_UADDO %1, %4
32    %5:_(s64) = G_ZEXT %3(s1)
33    $x0 = COPY %5(s64)
34    RET_ReallyLR implicit $x0
35
36...
37