llvm/llvm/test/CodeGen/RISCV/GlobalISel/legalizer/legalize-addo-subo-rv32.mir

# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
# RUN: llc -mtriple=riscv32 -run-pass=legalizer %s -o - \
# RUN: | FileCheck %s

---
name:            saddo_i8
body:             |
  bb.1:
    liveins: $x10, $x11

    ; CHECK-LABEL: name: saddo_i8
    ; CHECK: liveins: $x10, $x11
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
    ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
    ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 24
    ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY]], [[C]](s32)
    ; CHECK-NEXT: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[C]](s32)
    ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 24
    ; CHECK-NEXT: [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[COPY1]], [[C1]](s32)
    ; CHECK-NEXT: [[ASHR1:%[0-9]+]]:_(s32) = G_ASHR [[SHL1]], [[C1]](s32)
    ; CHECK-NEXT: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[ASHR]], [[ASHR1]]
    ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 24
    ; CHECK-NEXT: [[SHL2:%[0-9]+]]:_(s32) = G_SHL [[ADD]], [[C2]](s32)
    ; CHECK-NEXT: [[ASHR2:%[0-9]+]]:_(s32) = G_ASHR [[SHL2]], [[C2]](s32)
    ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ne), [[ADD]](s32), [[ASHR2]]
    ; CHECK-NEXT: $x10 = COPY [[ADD]](s32)
    ; CHECK-NEXT: $x11 = COPY [[ICMP]](s32)
    ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11
    %2:_(s32) = COPY $x10
    %0:_(s8) = G_TRUNC %2(s32)
    %3:_(s32) = COPY $x11
    %1:_(s8) = G_TRUNC %3(s32)
    %4:_(s8), %5:_(s1) = G_SADDO %0, %1
    %6:_(s32) = G_ANYEXT %4(s8)
    %7:_(s32) = G_ANYEXT %5(s1)
    $x10 = COPY %6(s32)
    $x11 = COPY %7(s32)
    PseudoRET implicit $x10, implicit $x11

...
---
name:            saddo_i16
body:             |
  bb.1:
    liveins: $x10, $x11

    ; CHECK-LABEL: name: saddo_i16
    ; CHECK: liveins: $x10, $x11
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
    ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
    ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
    ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY]], [[C]](s32)
    ; CHECK-NEXT: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[C]](s32)
    ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
    ; CHECK-NEXT: [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[COPY1]], [[C1]](s32)
    ; CHECK-NEXT: [[ASHR1:%[0-9]+]]:_(s32) = G_ASHR [[SHL1]], [[C1]](s32)
    ; CHECK-NEXT: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[ASHR]], [[ASHR1]]
    ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
    ; CHECK-NEXT: [[SHL2:%[0-9]+]]:_(s32) = G_SHL [[ADD]], [[C2]](s32)
    ; CHECK-NEXT: [[ASHR2:%[0-9]+]]:_(s32) = G_ASHR [[SHL2]], [[C2]](s32)
    ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ne), [[ADD]](s32), [[ASHR2]]
    ; CHECK-NEXT: $x10 = COPY [[ADD]](s32)
    ; CHECK-NEXT: $x11 = COPY [[ICMP]](s32)
    ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11
    %2:_(s32) = COPY $x10
    %0:_(s16) = G_TRUNC %2(s32)
    %3:_(s32) = COPY $x11
    %1:_(s16) = G_TRUNC %3(s32)
    %4:_(s16), %5:_(s1) = G_SADDO %0, %1
    %6:_(s32) = G_ANYEXT %4(s16)
    %7:_(s32) = G_ANYEXT %5(s1)
    $x10 = COPY %6(s32)
    $x11 = COPY %7(s32)
    PseudoRET implicit $x10, implicit $x11

...
---
name:            saddo_i32
body:             |
  bb.1:
    liveins: $x10, $x11

    ; CHECK-LABEL: name: saddo_i32
    ; CHECK: liveins: $x10, $x11
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
    ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
    ; CHECK-NEXT: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[COPY1]]
    ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
    ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(slt), [[ADD]](s32), [[COPY]]
    ; CHECK-NEXT: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(slt), [[COPY1]](s32), [[C]]
    ; CHECK-NEXT: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[ICMP1]], [[ICMP]]
    ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY [[ADD]](s32)
    ; CHECK-NEXT: $x10 = COPY [[COPY2]](s32)
    ; CHECK-NEXT: $x11 = COPY [[XOR]](s32)
    ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11
    %0:_(s32) = COPY $x10
    %1:_(s32) = COPY $x11
    %2:_(s32), %3:_(s1) = G_SADDO %0, %1
    %4:_(s32) = G_ANYEXT %3(s1)
    $x10 = COPY %2(s32)
    $x11 = COPY %4(s32)
    PseudoRET implicit $x10, implicit $x11

...
---
name:            saddo_i64
body:             |
  bb.1:
    liveins: $x10, $x11, $x12, $x13

    ; CHECK-LABEL: name: saddo_i64
    ; CHECK: liveins: $x10, $x11, $x12, $x13
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
    ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
    ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $x12
    ; CHECK-NEXT: [[COPY3:%[0-9]+]]:_(s32) = COPY $x13
    ; CHECK-NEXT: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[COPY2]]
    ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[ADD]](s32), [[COPY2]]
    ; CHECK-NEXT: [[COPY4:%[0-9]+]]:_(s32) = COPY [[ADD]](s32)
    ; CHECK-NEXT: [[ADD1:%[0-9]+]]:_(s32) = G_ADD [[COPY1]], [[COPY3]]
    ; CHECK-NEXT: [[ADD2:%[0-9]+]]:_(s32) = G_ADD [[ADD1]], [[ICMP]]
    ; CHECK-NEXT: [[COPY5:%[0-9]+]]:_(s32) = COPY [[ADD2]](s32)
    ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
    ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
    ; CHECK-NEXT: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(slt), [[COPY5]](s32), [[COPY1]]
    ; CHECK-NEXT: [[ICMP2:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[COPY5]](s32), [[COPY1]]
    ; CHECK-NEXT: [[ICMP3:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[COPY4]](s32), [[COPY]]
    ; CHECK-NEXT: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP2]](s32), [[ICMP3]], [[ICMP1]]
    ; CHECK-NEXT: [[ICMP4:%[0-9]+]]:_(s32) = G_ICMP intpred(slt), [[COPY3]](s32), [[C1]]
    ; CHECK-NEXT: [[ICMP5:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[COPY3]](s32), [[C1]]
    ; CHECK-NEXT: [[ICMP6:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[COPY2]](s32), [[C]]
    ; CHECK-NEXT: [[SELECT1:%[0-9]+]]:_(s32) = G_SELECT [[ICMP5]](s32), [[ICMP6]], [[ICMP4]]
    ; CHECK-NEXT: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[SELECT1]], [[SELECT]]
    ; CHECK-NEXT: $x10 = COPY [[COPY4]](s32)
    ; CHECK-NEXT: $x11 = COPY [[COPY5]](s32)
    ; CHECK-NEXT: $x12 = COPY [[XOR]](s32)
    ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11, implicit $x12
    %2:_(s32) = COPY $x10
    %3:_(s32) = COPY $x11
    %0:_(s64) = G_MERGE_VALUES %2(s32), %3(s32)
    %4:_(s32) = COPY $x12
    %5:_(s32) = COPY $x13
    %1:_(s64) = G_MERGE_VALUES %4(s32), %5(s32)
    %6:_(s64), %7:_(s1) = G_SADDO %0, %1
    %8:_(s32), %9:_(s32) = G_UNMERGE_VALUES %6(s64)
    %10:_(s32) = G_ANYEXT %7(s1)
    $x10 = COPY %8(s32)
    $x11 = COPY %9(s32)
    $x12 = COPY %10(s32)
    PseudoRET implicit $x10, implicit $x11, implicit $x12

...
---
name:            ssubo_i8
body:             |
  bb.1:
    liveins: $x10, $x11

    ; CHECK-LABEL: name: ssubo_i8
    ; CHECK: liveins: $x10, $x11
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
    ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
    ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 24
    ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY]], [[C]](s32)
    ; CHECK-NEXT: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[C]](s32)
    ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 24
    ; CHECK-NEXT: [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[COPY1]], [[C1]](s32)
    ; CHECK-NEXT: [[ASHR1:%[0-9]+]]:_(s32) = G_ASHR [[SHL1]], [[C1]](s32)
    ; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[ASHR]], [[ASHR1]]
    ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 24
    ; CHECK-NEXT: [[SHL2:%[0-9]+]]:_(s32) = G_SHL [[SUB]], [[C2]](s32)
    ; CHECK-NEXT: [[ASHR2:%[0-9]+]]:_(s32) = G_ASHR [[SHL2]], [[C2]](s32)
    ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ne), [[SUB]](s32), [[ASHR2]]
    ; CHECK-NEXT: $x10 = COPY [[SUB]](s32)
    ; CHECK-NEXT: $x11 = COPY [[ICMP]](s32)
    ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11
    %2:_(s32) = COPY $x10
    %0:_(s8) = G_TRUNC %2(s32)
    %3:_(s32) = COPY $x11
    %1:_(s8) = G_TRUNC %3(s32)
    %4:_(s8), %5:_(s1) = G_SSUBO %0, %1
    %6:_(s32) = G_ANYEXT %4(s8)
    %7:_(s32) = G_ANYEXT %5(s1)
    $x10 = COPY %6(s32)
    $x11 = COPY %7(s32)
    PseudoRET implicit $x10, implicit $x11

...
---
name:            ssubo_i16
body:             |
  bb.1:
    liveins: $x10, $x11

    ; CHECK-LABEL: name: ssubo_i16
    ; CHECK: liveins: $x10, $x11
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
    ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
    ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
    ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY]], [[C]](s32)
    ; CHECK-NEXT: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[C]](s32)
    ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
    ; CHECK-NEXT: [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[COPY1]], [[C1]](s32)
    ; CHECK-NEXT: [[ASHR1:%[0-9]+]]:_(s32) = G_ASHR [[SHL1]], [[C1]](s32)
    ; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[ASHR]], [[ASHR1]]
    ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
    ; CHECK-NEXT: [[SHL2:%[0-9]+]]:_(s32) = G_SHL [[SUB]], [[C2]](s32)
    ; CHECK-NEXT: [[ASHR2:%[0-9]+]]:_(s32) = G_ASHR [[SHL2]], [[C2]](s32)
    ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ne), [[SUB]](s32), [[ASHR2]]
    ; CHECK-NEXT: $x10 = COPY [[SUB]](s32)
    ; CHECK-NEXT: $x11 = COPY [[ICMP]](s32)
    ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11
    %2:_(s32) = COPY $x10
    %0:_(s16) = G_TRUNC %2(s32)
    %3:_(s32) = COPY $x11
    %1:_(s16) = G_TRUNC %3(s32)
    %4:_(s16), %5:_(s1) = G_SSUBO %0, %1
    %6:_(s32) = G_ANYEXT %4(s16)
    %7:_(s32) = G_ANYEXT %5(s1)
    $x10 = COPY %6(s32)
    $x11 = COPY %7(s32)
    PseudoRET implicit $x10, implicit $x11

...
---
name:            ssubo_i32
body:             |
  bb.1:
    liveins: $x10, $x11

    ; CHECK-LABEL: name: ssubo_i32
    ; CHECK: liveins: $x10, $x11
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
    ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
    ; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[COPY]], [[COPY1]]
    ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
    ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(slt), [[SUB]](s32), [[COPY]]
    ; CHECK-NEXT: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(sgt), [[COPY1]](s32), [[C]]
    ; CHECK-NEXT: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[ICMP1]], [[ICMP]]
    ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY [[SUB]](s32)
    ; CHECK-NEXT: $x10 = COPY [[COPY2]](s32)
    ; CHECK-NEXT: $x11 = COPY [[XOR]](s32)
    ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11
    %0:_(s32) = COPY $x10
    %1:_(s32) = COPY $x11
    %2:_(s32), %3:_(s1) = G_SSUBO %0, %1
    %4:_(s32) = G_ANYEXT %3(s1)
    $x10 = COPY %2(s32)
    $x11 = COPY %4(s32)
    PseudoRET implicit $x10, implicit $x11

...
---
name:            ssubo_i64
body:             |
  bb.1:
    liveins: $x10, $x11, $x12, $x13

    ; CHECK-LABEL: name: ssubo_i64
    ; CHECK: liveins: $x10, $x11, $x12, $x13
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
    ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
    ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $x12
    ; CHECK-NEXT: [[COPY3:%[0-9]+]]:_(s32) = COPY $x13
    ; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[COPY]], [[COPY2]]
    ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[COPY]](s32), [[COPY2]]
    ; CHECK-NEXT: [[SUB1:%[0-9]+]]:_(s32) = G_SUB [[COPY1]], [[COPY3]]
    ; CHECK-NEXT: [[SUB2:%[0-9]+]]:_(s32) = G_SUB [[SUB1]], [[ICMP]]
    ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
    ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
    ; CHECK-NEXT: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(slt), [[SUB2]](s32), [[COPY1]]
    ; CHECK-NEXT: [[ICMP2:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[SUB2]](s32), [[COPY1]]
    ; CHECK-NEXT: [[ICMP3:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[SUB]](s32), [[COPY]]
    ; CHECK-NEXT: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP2]](s32), [[ICMP3]], [[ICMP1]]
    ; CHECK-NEXT: [[ICMP4:%[0-9]+]]:_(s32) = G_ICMP intpred(sgt), [[COPY3]](s32), [[C1]]
    ; CHECK-NEXT: [[ICMP5:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[COPY3]](s32), [[C1]]
    ; CHECK-NEXT: [[ICMP6:%[0-9]+]]:_(s32) = G_ICMP intpred(ugt), [[COPY2]](s32), [[C]]
    ; CHECK-NEXT: [[SELECT1:%[0-9]+]]:_(s32) = G_SELECT [[ICMP5]](s32), [[ICMP6]], [[ICMP4]]
    ; CHECK-NEXT: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[SELECT1]], [[SELECT]]
    ; CHECK-NEXT: $x10 = COPY [[SUB]](s32)
    ; CHECK-NEXT: $x11 = COPY [[SUB2]](s32)
    ; CHECK-NEXT: $x12 = COPY [[XOR]](s32)
    ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11, implicit $x12
    %2:_(s32) = COPY $x10
    %3:_(s32) = COPY $x11
    %0:_(s64) = G_MERGE_VALUES %2(s32), %3(s32)
    %4:_(s32) = COPY $x12
    %5:_(s32) = COPY $x13
    %1:_(s64) = G_MERGE_VALUES %4(s32), %5(s32)
    %6:_(s64), %7:_(s1) = G_SSUBO %0, %1
    %8:_(s32), %9:_(s32) = G_UNMERGE_VALUES %6(s64)
    %10:_(s32) = G_ANYEXT %7(s1)
    $x10 = COPY %8(s32)
    $x11 = COPY %9(s32)
    $x12 = COPY %10(s32)
    PseudoRET implicit $x10, implicit $x11, implicit $x12

...
---
name:            uaddo_i8
body:             |
  bb.1:
    liveins: $x10, $x11

    ; CHECK-LABEL: name: uaddo_i8
    ; CHECK: liveins: $x10, $x11
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
    ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
    ; CHECK-NEXT: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[COPY1]]
    ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
    ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ADD]], [[C]]
    ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
    ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C1]]
    ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[AND]](s32), [[AND1]]
    ; CHECK-NEXT: $x10 = COPY [[ADD]](s32)
    ; CHECK-NEXT: $x11 = COPY [[ICMP]](s32)
    ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11
    %2:_(s32) = COPY $x10
    %0:_(s8) = G_TRUNC %2(s32)
    %3:_(s32) = COPY $x11
    %1:_(s8) = G_TRUNC %3(s32)
    %4:_(s8), %5:_(s1) = G_UADDO %0, %1
    %6:_(s32) = G_ANYEXT %4(s8)
    %7:_(s32) = G_ANYEXT %5(s1)
    $x10 = COPY %6(s32)
    $x11 = COPY %7(s32)
    PseudoRET implicit $x10, implicit $x11

...
---
name:            uaddo_i16
body:             |
  bb.1:
    liveins: $x10, $x11

    ; CHECK-LABEL: name: uaddo_i16
    ; CHECK: liveins: $x10, $x11
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
    ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
    ; CHECK-NEXT: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[COPY1]]
    ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
    ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ADD]], [[C]]
    ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
    ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C1]]
    ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[AND]](s32), [[AND1]]
    ; CHECK-NEXT: $x10 = COPY [[ADD]](s32)
    ; CHECK-NEXT: $x11 = COPY [[ICMP]](s32)
    ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11
    %2:_(s32) = COPY $x10
    %0:_(s16) = G_TRUNC %2(s32)
    %3:_(s32) = COPY $x11
    %1:_(s16) = G_TRUNC %3(s32)
    %4:_(s16), %5:_(s1) = G_UADDO %0, %1
    %6:_(s32) = G_ANYEXT %4(s16)
    %7:_(s32) = G_ANYEXT %5(s1)
    $x10 = COPY %6(s32)
    $x11 = COPY %7(s32)
    PseudoRET implicit $x10, implicit $x11

...
---
name:            uaddo_i32
body:             |
  bb.1:
    liveins: $x10, $x11

    ; CHECK-LABEL: name: uaddo_i32
    ; CHECK: liveins: $x10, $x11
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
    ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
    ; CHECK-NEXT: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[COPY1]]
    ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[ADD]](s32), [[COPY1]]
    ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY [[ADD]](s32)
    ; CHECK-NEXT: $x10 = COPY [[COPY2]](s32)
    ; CHECK-NEXT: $x11 = COPY [[ICMP]](s32)
    ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11
    %0:_(s32) = COPY $x10
    %1:_(s32) = COPY $x11
    %2:_(s32), %3:_(s1) = G_UADDO %0, %1
    %4:_(s32) = G_ANYEXT %3(s1)
    $x10 = COPY %2(s32)
    $x11 = COPY %4(s32)
    PseudoRET implicit $x10, implicit $x11

...
---
name:            uaddo_i64
body:             |
  bb.1:
    liveins: $x10, $x11, $x12, $x13

    ; CHECK-LABEL: name: uaddo_i64
    ; CHECK: liveins: $x10, $x11, $x12, $x13
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
    ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
    ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $x12
    ; CHECK-NEXT: [[COPY3:%[0-9]+]]:_(s32) = COPY $x13
    ; CHECK-NEXT: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[COPY2]]
    ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[ADD]](s32), [[COPY2]]
    ; CHECK-NEXT: [[COPY4:%[0-9]+]]:_(s32) = COPY [[ADD]](s32)
    ; CHECK-NEXT: [[ADD1:%[0-9]+]]:_(s32) = G_ADD [[COPY1]], [[COPY3]]
    ; CHECK-NEXT: [[ADD2:%[0-9]+]]:_(s32) = G_ADD [[ADD1]], [[ICMP]]
    ; CHECK-NEXT: [[COPY5:%[0-9]+]]:_(s32) = COPY [[ADD2]](s32)
    ; CHECK-NEXT: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[COPY5]](s32), [[COPY3]]
    ; CHECK-NEXT: [[ICMP2:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[COPY5]](s32), [[COPY3]]
    ; CHECK-NEXT: [[ICMP3:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[COPY4]](s32), [[COPY2]]
    ; CHECK-NEXT: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP2]](s32), [[ICMP3]], [[ICMP1]]
    ; CHECK-NEXT: $x10 = COPY [[COPY4]](s32)
    ; CHECK-NEXT: $x11 = COPY [[COPY5]](s32)
    ; CHECK-NEXT: $x12 = COPY [[SELECT]](s32)
    ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11, implicit $x12
    %2:_(s32) = COPY $x10
    %3:_(s32) = COPY $x11
    %0:_(s64) = G_MERGE_VALUES %2(s32), %3(s32)
    %4:_(s32) = COPY $x12
    %5:_(s32) = COPY $x13
    %1:_(s64) = G_MERGE_VALUES %4(s32), %5(s32)
    %6:_(s64), %7:_(s1) = G_UADDO %0, %1
    %8:_(s32), %9:_(s32) = G_UNMERGE_VALUES %6(s64)
    %10:_(s32) = G_ANYEXT %7(s1)
    $x10 = COPY %8(s32)
    $x11 = COPY %9(s32)
    $x12 = COPY %10(s32)
    PseudoRET implicit $x10, implicit $x11, implicit $x12

...
---
name:            usubo_i8
body:             |
  bb.1:
    liveins: $x10, $x11

    ; CHECK-LABEL: name: usubo_i8
    ; CHECK: liveins: $x10, $x11
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
    ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
    ; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[COPY]], [[COPY1]]
    ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
    ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]]
    ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
    ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C1]]
    ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[AND]](s32), [[AND1]]
    ; CHECK-NEXT: $x10 = COPY [[SUB]](s32)
    ; CHECK-NEXT: $x11 = COPY [[ICMP]](s32)
    ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11
    %2:_(s32) = COPY $x10
    %0:_(s8) = G_TRUNC %2(s32)
    %3:_(s32) = COPY $x11
    %1:_(s8) = G_TRUNC %3(s32)
    %4:_(s8), %5:_(s1) = G_USUBO %0, %1
    %6:_(s32) = G_ANYEXT %4(s8)
    %7:_(s32) = G_ANYEXT %5(s1)
    $x10 = COPY %6(s32)
    $x11 = COPY %7(s32)
    PseudoRET implicit $x10, implicit $x11

...
---
name:            usubo_i16
body:             |
  bb.1:
    liveins: $x10, $x11

    ; CHECK-LABEL: name: usubo_i16
    ; CHECK: liveins: $x10, $x11
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
    ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
    ; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[COPY]], [[COPY1]]
    ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
    ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]]
    ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
    ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C1]]
    ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[AND]](s32), [[AND1]]
    ; CHECK-NEXT: $x10 = COPY [[SUB]](s32)
    ; CHECK-NEXT: $x11 = COPY [[ICMP]](s32)
    ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11
    %2:_(s32) = COPY $x10
    %0:_(s16) = G_TRUNC %2(s32)
    %3:_(s32) = COPY $x11
    %1:_(s16) = G_TRUNC %3(s32)
    %4:_(s16), %5:_(s1) = G_USUBO %0, %1
    %6:_(s32) = G_ANYEXT %4(s16)
    %7:_(s32) = G_ANYEXT %5(s1)
    $x10 = COPY %6(s32)
    $x11 = COPY %7(s32)
    PseudoRET implicit $x10, implicit $x11

...
---
name:            usubo_i32
body:             |
  bb.1:
    liveins: $x10, $x11

    ; CHECK-LABEL: name: usubo_i32
    ; CHECK: liveins: $x10, $x11
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
    ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
    ; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[COPY]], [[COPY1]]
    ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[COPY]](s32), [[COPY1]]
    ; CHECK-NEXT: $x10 = COPY [[SUB]](s32)
    ; CHECK-NEXT: $x11 = COPY [[ICMP]](s32)
    ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11
    %0:_(s32) = COPY $x10
    %1:_(s32) = COPY $x11
    %2:_(s32), %3:_(s1) = G_USUBO %0, %1
    %4:_(s32) = G_ANYEXT %3(s1)
    $x10 = COPY %2(s32)
    $x11 = COPY %4(s32)
    PseudoRET implicit $x10, implicit $x11

...
---
name:            usubo_i64
body:             |
  bb.1:
    liveins: $x10, $x11, $x12, $x13

    ; CHECK-LABEL: name: usubo_i64
    ; CHECK: liveins: $x10, $x11, $x12, $x13
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
    ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
    ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $x12
    ; CHECK-NEXT: [[COPY3:%[0-9]+]]:_(s32) = COPY $x13
    ; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[COPY]], [[COPY2]]
    ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[COPY]](s32), [[COPY2]]
    ; CHECK-NEXT: [[SUB1:%[0-9]+]]:_(s32) = G_SUB [[COPY1]], [[COPY3]]
    ; CHECK-NEXT: [[SUB2:%[0-9]+]]:_(s32) = G_SUB [[SUB1]], [[ICMP]]
    ; CHECK-NEXT: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[COPY1]](s32), [[COPY3]]
    ; CHECK-NEXT: [[ICMP2:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[COPY1]](s32), [[COPY3]]
    ; CHECK-NEXT: [[ICMP3:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[COPY]](s32), [[COPY2]]
    ; CHECK-NEXT: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP2]](s32), [[ICMP3]], [[ICMP1]]
    ; CHECK-NEXT: $x10 = COPY [[SUB]](s32)
    ; CHECK-NEXT: $x11 = COPY [[SUB2]](s32)
    ; CHECK-NEXT: $x12 = COPY [[SELECT]](s32)
    ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11, implicit $x12
    %2:_(s32) = COPY $x10
    %3:_(s32) = COPY $x11
    %0:_(s64) = G_MERGE_VALUES %2(s32), %3(s32)
    %4:_(s32) = COPY $x12
    %5:_(s32) = COPY $x13
    %1:_(s64) = G_MERGE_VALUES %4(s32), %5(s32)
    %6:_(s64), %7:_(s1) = G_USUBO %0, %1
    %8:_(s32), %9:_(s32) = G_UNMERGE_VALUES %6(s64)
    %10:_(s32) = G_ANYEXT %7(s1)
    $x10 = COPY %8(s32)
    $x11 = COPY %9(s32)
    $x12 = COPY %10(s32)
    PseudoRET implicit $x10, implicit $x11, implicit $x12

...