llvm/llvm/test/CodeGen/RISCV/GlobalISel/regbankselect/alu-rv64.mir

# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
# RUN: llc -mtriple=riscv64 -mattr=+m -run-pass=regbankselect \
# RUN:   -disable-gisel-legality-check -simplify-mir -verify-machineinstrs %s \
# RUN:   -o - | FileCheck -check-prefix=RV64I %s

---
name:            add_i64
legalized:       true
tracksRegLiveness: true
body:             |
  bb.0.entry:
    liveins: $x10, $x11

    ; RV64I-LABEL: name: add_i64
    ; RV64I: liveins: $x10, $x11
    ; RV64I-NEXT: {{  $}}
    ; RV64I-NEXT: [[COPY:%[0-9]+]]:gprb(s64) = COPY $x10
    ; RV64I-NEXT: [[COPY1:%[0-9]+]]:gprb(s64) = COPY $x11
    ; RV64I-NEXT: [[ADD:%[0-9]+]]:gprb(s64) = G_ADD [[COPY]], [[COPY1]]
    ; RV64I-NEXT: $x10 = COPY [[ADD]](s64)
    ; RV64I-NEXT: PseudoRET implicit $x10
    %0:_(s64) = COPY $x10
    %1:_(s64) = COPY $x11
    %2:_(s64) = G_ADD %0, %1
    $x10 = COPY %2(s64)
    PseudoRET implicit $x10

...
---
name:            sub_i64
legalized:       true
tracksRegLiveness: true
body:             |
  bb.0.entry:
    liveins: $x10, $x11

    ; RV64I-LABEL: name: sub_i64
    ; RV64I: liveins: $x10, $x11
    ; RV64I-NEXT: {{  $}}
    ; RV64I-NEXT: [[COPY:%[0-9]+]]:gprb(s64) = COPY $x10
    ; RV64I-NEXT: [[COPY1:%[0-9]+]]:gprb(s64) = COPY $x11
    ; RV64I-NEXT: [[SUB:%[0-9]+]]:gprb(s64) = G_SUB [[COPY]], [[COPY1]]
    ; RV64I-NEXT: $x10 = COPY [[SUB]](s64)
    ; RV64I-NEXT: PseudoRET implicit $x10
    %0:_(s64) = COPY $x10
    %1:_(s64) = COPY $x11
    %2:_(s64) = G_SUB %0, %1
    $x10 = COPY %2(s64)
    PseudoRET implicit $x10

...
---
name:            shl_i64
legalized:       true
tracksRegLiveness: true
body:             |
  bb.0.entry:
    liveins: $x10, $x11

    ; RV64I-LABEL: name: shl_i64
    ; RV64I: liveins: $x10, $x11
    ; RV64I-NEXT: {{  $}}
    ; RV64I-NEXT: [[COPY:%[0-9]+]]:gprb(s64) = COPY $x10
    ; RV64I-NEXT: [[COPY1:%[0-9]+]]:gprb(s64) = COPY $x11
    ; RV64I-NEXT: [[SHL:%[0-9]+]]:gprb(s64) = G_SHL [[COPY]], [[COPY1]](s64)
    ; RV64I-NEXT: $x10 = COPY [[SHL]](s64)
    ; RV64I-NEXT: PseudoRET implicit $x10
    %0:_(s64) = COPY $x10
    %1:_(s64) = COPY $x11
    %2:_(s64) = G_SHL %0, %1
    $x10 = COPY %2(s64)
    PseudoRET implicit $x10

...
---
name:            ashr_i64
legalized:       true
tracksRegLiveness: true
body:             |
  bb.0.entry:
    liveins: $x10, $x11

    ; RV64I-LABEL: name: ashr_i64
    ; RV64I: liveins: $x10, $x11
    ; RV64I-NEXT: {{  $}}
    ; RV64I-NEXT: [[COPY:%[0-9]+]]:gprb(s64) = COPY $x10
    ; RV64I-NEXT: [[COPY1:%[0-9]+]]:gprb(s64) = COPY $x11
    ; RV64I-NEXT: [[ASHR:%[0-9]+]]:gprb(s64) = G_ASHR [[COPY]], [[COPY1]](s64)
    ; RV64I-NEXT: $x10 = COPY [[ASHR]](s64)
    ; RV64I-NEXT: PseudoRET implicit $x10
    %0:_(s64) = COPY $x10
    %1:_(s64) = COPY $x11
    %2:_(s64) = G_ASHR %0, %1
    $x10 = COPY %2(s64)
    PseudoRET implicit $x10

...
---
name:            lshr_i64
legalized:       true
tracksRegLiveness: true
body:             |
  bb.0.entry:
    liveins: $x10, $x11

    ; RV64I-LABEL: name: lshr_i64
    ; RV64I: liveins: $x10, $x11
    ; RV64I-NEXT: {{  $}}
    ; RV64I-NEXT: [[COPY:%[0-9]+]]:gprb(s64) = COPY $x10
    ; RV64I-NEXT: [[COPY1:%[0-9]+]]:gprb(s64) = COPY $x11
    ; RV64I-NEXT: [[LSHR:%[0-9]+]]:gprb(s64) = G_LSHR [[COPY]], [[COPY1]](s64)
    ; RV64I-NEXT: $x10 = COPY [[LSHR]](s64)
    ; RV64I-NEXT: PseudoRET implicit $x10
    %0:_(s64) = COPY $x10
    %1:_(s64) = COPY $x11
    %2:_(s64) = G_LSHR %0, %1
    $x10 = COPY %2(s64)
    PseudoRET implicit $x10

...
---
name:            and_i64
legalized:       true
tracksRegLiveness: true
body:             |
  bb.0.entry:
    liveins: $x10, $x11

    ; RV64I-LABEL: name: and_i64
    ; RV64I: liveins: $x10, $x11
    ; RV64I-NEXT: {{  $}}
    ; RV64I-NEXT: [[COPY:%[0-9]+]]:gprb(s64) = COPY $x10
    ; RV64I-NEXT: [[COPY1:%[0-9]+]]:gprb(s64) = COPY $x11
    ; RV64I-NEXT: [[AND:%[0-9]+]]:gprb(s64) = G_AND [[COPY]], [[COPY1]]
    ; RV64I-NEXT: $x10 = COPY [[AND]](s64)
    ; RV64I-NEXT: PseudoRET implicit $x10
    %0:_(s64) = COPY $x10
    %1:_(s64) = COPY $x11
    %2:_(s64) = G_AND %0, %1
    $x10 = COPY %2(s64)
    PseudoRET implicit $x10

...
---
name:            or_i64
legalized:       true
tracksRegLiveness: true
body:             |
  bb.0.entry:
    liveins: $x10, $x11

    ; RV64I-LABEL: name: or_i64
    ; RV64I: liveins: $x10, $x11
    ; RV64I-NEXT: {{  $}}
    ; RV64I-NEXT: [[COPY:%[0-9]+]]:gprb(s64) = COPY $x10
    ; RV64I-NEXT: [[COPY1:%[0-9]+]]:gprb(s64) = COPY $x11
    ; RV64I-NEXT: [[OR:%[0-9]+]]:gprb(s64) = G_OR [[COPY]], [[COPY1]]
    ; RV64I-NEXT: $x10 = COPY [[OR]](s64)
    ; RV64I-NEXT: PseudoRET implicit $x10
    %0:_(s64) = COPY $x10
    %1:_(s64) = COPY $x11
    %2:_(s64) = G_OR %0, %1
    $x10 = COPY %2(s64)
    PseudoRET implicit $x10

...
---
name:            xor_i64
legalized:       true
tracksRegLiveness: true
body:             |
  bb.0.entry:
    liveins: $x10, $x11

    ; RV64I-LABEL: name: xor_i64
    ; RV64I: liveins: $x10, $x11
    ; RV64I-NEXT: {{  $}}
    ; RV64I-NEXT: [[COPY:%[0-9]+]]:gprb(s64) = COPY $x10
    ; RV64I-NEXT: [[COPY1:%[0-9]+]]:gprb(s64) = COPY $x11
    ; RV64I-NEXT: [[XOR:%[0-9]+]]:gprb(s64) = G_XOR [[COPY]], [[COPY1]]
    ; RV64I-NEXT: $x10 = COPY [[XOR]](s64)
    ; RV64I-NEXT: PseudoRET implicit $x10
    %0:_(s64) = COPY $x10
    %1:_(s64) = COPY $x11
    %2:_(s64) = G_XOR %0, %1
    $x10 = COPY %2(s64)
    PseudoRET implicit $x10

...
---
name:            mul_i64
legalized:       true
tracksRegLiveness: true
body:             |
  bb.0.entry:
    liveins: $x10, $x11

    ; RV64I-LABEL: name: mul_i64
    ; RV64I: liveins: $x10, $x11
    ; RV64I-NEXT: {{  $}}
    ; RV64I-NEXT: [[COPY:%[0-9]+]]:gprb(s64) = COPY $x10
    ; RV64I-NEXT: [[COPY1:%[0-9]+]]:gprb(s64) = COPY $x11
    ; RV64I-NEXT: [[MUL:%[0-9]+]]:gprb(s64) = G_MUL [[COPY]], [[COPY1]]
    ; RV64I-NEXT: $x10 = COPY [[MUL]](s64)
    ; RV64I-NEXT: PseudoRET implicit $x10
    %0:_(s64) = COPY $x10
    %1:_(s64) = COPY $x11
    %2:_(s64) = G_MUL %0, %1
    $x10 = COPY %2(s64)
    PseudoRET implicit $x10

...
---
name:            sdiv_i64
legalized:       true
tracksRegLiveness: true
body:             |
  bb.0.entry:
    liveins: $x10, $x11

    ; RV64I-LABEL: name: sdiv_i64
    ; RV64I: liveins: $x10, $x11
    ; RV64I-NEXT: {{  $}}
    ; RV64I-NEXT: [[COPY:%[0-9]+]]:gprb(s64) = COPY $x10
    ; RV64I-NEXT: [[COPY1:%[0-9]+]]:gprb(s64) = COPY $x11
    ; RV64I-NEXT: [[SDIV:%[0-9]+]]:gprb(s64) = G_SDIV [[COPY]], [[COPY1]]
    ; RV64I-NEXT: $x10 = COPY [[SDIV]](s64)
    ; RV64I-NEXT: PseudoRET implicit $x10
    %0:_(s64) = COPY $x10
    %1:_(s64) = COPY $x11
    %2:_(s64) = G_SDIV %0, %1
    $x10 = COPY %2(s64)
    PseudoRET implicit $x10

...
---
name:            srem_i64
legalized:       true
tracksRegLiveness: true
body:             |
  bb.0.entry:
    liveins: $x10, $x11

    ; RV64I-LABEL: name: srem_i64
    ; RV64I: liveins: $x10, $x11
    ; RV64I-NEXT: {{  $}}
    ; RV64I-NEXT: [[COPY:%[0-9]+]]:gprb(s64) = COPY $x10
    ; RV64I-NEXT: [[COPY1:%[0-9]+]]:gprb(s64) = COPY $x11
    ; RV64I-NEXT: [[SREM:%[0-9]+]]:gprb(s64) = G_SREM [[COPY]], [[COPY1]]
    ; RV64I-NEXT: $x10 = COPY [[SREM]](s64)
    ; RV64I-NEXT: PseudoRET implicit $x10
    %0:_(s64) = COPY $x10
    %1:_(s64) = COPY $x11
    %2:_(s64) = G_SREM %0, %1
    $x10 = COPY %2(s64)
    PseudoRET implicit $x10

...
---
name:            smulh_i64
legalized:       true
tracksRegLiveness: true
body:             |
  bb.0.entry:
    liveins: $x10, $x11

    ; RV64I-LABEL: name: smulh_i64
    ; RV64I: liveins: $x10, $x11
    ; RV64I-NEXT: {{  $}}
    ; RV64I-NEXT: [[COPY:%[0-9]+]]:gprb(s64) = COPY $x10
    ; RV64I-NEXT: [[COPY1:%[0-9]+]]:gprb(s64) = COPY $x11
    ; RV64I-NEXT: [[SMULH:%[0-9]+]]:gprb(s64) = G_SMULH [[COPY]], [[COPY1]]
    ; RV64I-NEXT: $x10 = COPY [[SMULH]](s64)
    ; RV64I-NEXT: PseudoRET implicit $x10
    %0:_(s64) = COPY $x10
    %1:_(s64) = COPY $x11
    %2:_(s64) = G_SMULH %0, %1
    $x10 = COPY %2(s64)
    PseudoRET implicit $x10

...
---
name:            udiv_i64
legalized:       true
tracksRegLiveness: true
body:             |
  bb.0.entry:
    liveins: $x10, $x11

    ; RV64I-LABEL: name: udiv_i64
    ; RV64I: liveins: $x10, $x11
    ; RV64I-NEXT: {{  $}}
    ; RV64I-NEXT: [[COPY:%[0-9]+]]:gprb(s64) = COPY $x10
    ; RV64I-NEXT: [[COPY1:%[0-9]+]]:gprb(s64) = COPY $x11
    ; RV64I-NEXT: [[UDIV:%[0-9]+]]:gprb(s64) = G_UDIV [[COPY]], [[COPY1]]
    ; RV64I-NEXT: $x10 = COPY [[UDIV]](s64)
    ; RV64I-NEXT: PseudoRET implicit $x10
    %0:_(s64) = COPY $x10
    %1:_(s64) = COPY $x11
    %2:_(s64) = G_UDIV %0, %1
    $x10 = COPY %2(s64)
    PseudoRET implicit $x10

...
---
name:            urem_i64
legalized:       true
tracksRegLiveness: true
body:             |
  bb.0.entry:
    liveins: $x10, $x11

    ; RV64I-LABEL: name: urem_i64
    ; RV64I: liveins: $x10, $x11
    ; RV64I-NEXT: {{  $}}
    ; RV64I-NEXT: [[COPY:%[0-9]+]]:gprb(s64) = COPY $x10
    ; RV64I-NEXT: [[COPY1:%[0-9]+]]:gprb(s64) = COPY $x11
    ; RV64I-NEXT: [[UREM:%[0-9]+]]:gprb(s64) = G_UREM [[COPY]], [[COPY1]]
    ; RV64I-NEXT: $x10 = COPY [[UREM]](s64)
    ; RV64I-NEXT: PseudoRET implicit $x10
    %0:_(s64) = COPY $x10
    %1:_(s64) = COPY $x11
    %2:_(s64) = G_UREM %0, %1
    $x10 = COPY %2(s64)
    PseudoRET implicit $x10

...
---
name:            umulh_i64
legalized:       true
tracksRegLiveness: true
body:             |
  bb.0.entry:
    liveins: $x10, $x11

    ; RV64I-LABEL: name: umulh_i64
    ; RV64I: liveins: $x10, $x11
    ; RV64I-NEXT: {{  $}}
    ; RV64I-NEXT: [[COPY:%[0-9]+]]:gprb(s64) = COPY $x10
    ; RV64I-NEXT: [[COPY1:%[0-9]+]]:gprb(s64) = COPY $x11
    ; RV64I-NEXT: [[UMULH:%[0-9]+]]:gprb(s64) = G_UMULH [[COPY]], [[COPY1]]
    ; RV64I-NEXT: $x10 = COPY [[UMULH]](s64)
    ; RV64I-NEXT: PseudoRET implicit $x10
    %0:_(s64) = COPY $x10
    %1:_(s64) = COPY $x11
    %2:_(s64) = G_UMULH %0, %1
    $x10 = COPY %2(s64)
    PseudoRET implicit $x10

...
---
name:            icmp_i64
legalized:       true
tracksRegLiveness: true
body:             |
  bb.0.entry:
    liveins: $x10, $x11

    ; RV64I-LABEL: name: icmp_i64
    ; RV64I: liveins: $x10, $x11
    ; RV64I-NEXT: {{  $}}
    ; RV64I-NEXT: [[COPY:%[0-9]+]]:gprb(s64) = COPY $x10
    ; RV64I-NEXT: [[COPY1:%[0-9]+]]:gprb(s64) = COPY $x11
    ; RV64I-NEXT: [[ICMP:%[0-9]+]]:gprb(s64) = G_ICMP intpred(eq), [[COPY]](s64), [[COPY1]]
    ; RV64I-NEXT: $x10 = COPY [[ICMP]](s64)
    ; RV64I-NEXT: PseudoRET implicit $x10
    %0:_(s64) = COPY $x10
    %1:_(s64) = COPY $x11
    %2:_(s64) = G_ICMP intpred(eq), %0(s64), %1
    $x10 = COPY %2(s64)
    PseudoRET implicit $x10

...
---
name:            icmp_ptr
legalized:       true
tracksRegLiveness: true
body:             |
  bb.0.entry:
    liveins: $x10, $x11

    ; RV64I-LABEL: name: icmp_ptr
    ; RV64I: liveins: $x10, $x11
    ; RV64I-NEXT: {{  $}}
    ; RV64I-NEXT: [[COPY:%[0-9]+]]:gprb(p0) = COPY $x10
    ; RV64I-NEXT: [[COPY1:%[0-9]+]]:gprb(p0) = COPY $x11
    ; RV64I-NEXT: [[ICMP:%[0-9]+]]:gprb(s64) = G_ICMP intpred(eq), [[COPY]](p0), [[COPY1]]
    ; RV64I-NEXT: $x10 = COPY [[ICMP]](s64)
    ; RV64I-NEXT: PseudoRET implicit $x10
    %0:_(p0) = COPY $x10
    %1:_(p0) = COPY $x11
    %2:_(s64) = G_ICMP intpred(eq), %0(p0), %1
    $x10 = COPY %2(s64)
    PseudoRET implicit $x10

...
---
name:            sext_inreg_i64
legalized:       true
tracksRegLiveness: true
body:             |
  bb.0.entry:
    liveins: $x10

    ; RV64I-LABEL: name: sext_inreg_i64
    ; RV64I: liveins: $x10
    ; RV64I-NEXT: {{  $}}
    ; RV64I-NEXT: [[COPY:%[0-9]+]]:gprb(s64) = COPY $x10
    ; RV64I-NEXT: [[SEXT_INREG:%[0-9]+]]:gprb(s64) = G_SEXT_INREG [[COPY]], 32
    ; RV64I-NEXT: $x10 = COPY [[SEXT_INREG]](s64)
    ; RV64I-NEXT: PseudoRET implicit $x10
    %0:_(s64) = COPY $x10
    %1:_(s64) = G_SEXT_INREG %0, 32
    $x10 = COPY %1(s64)
    PseudoRET implicit $x10

...
---
name:            gep
legalized:       true
tracksRegLiveness: true
body:             |
  bb.0.entry:
    liveins: $x10, $x11

    ; RV64I-LABEL: name: gep
    ; RV64I: liveins: $x10, $x11
    ; RV64I-NEXT: {{  $}}
    ; RV64I-NEXT: [[COPY:%[0-9]+]]:gprb(p0) = COPY $x10
    ; RV64I-NEXT: [[COPY1:%[0-9]+]]:gprb(s64) = COPY $x11
    ; RV64I-NEXT: [[PTR_ADD:%[0-9]+]]:gprb(p0) = G_PTR_ADD [[COPY]], [[COPY1]](s64)
    ; RV64I-NEXT: $x10 = COPY [[PTR_ADD]](p0)
    ; RV64I-NEXT: PseudoRET implicit $x10
    %0:_(p0) = COPY $x10
    %1:_(s64) = COPY $x11
    %2:_(p0) = G_PTR_ADD %0, %1(s64)
    $x10 = COPY %2(p0)
    PseudoRET implicit $x10

...
---
name:            ptrtoint
legalized:       true
tracksRegLiveness: true
body:             |
  bb.0.entry:
    liveins: $x10

    ; RV64I-LABEL: name: ptrtoint
    ; RV64I: liveins: $x10
    ; RV64I-NEXT: {{  $}}
    ; RV64I-NEXT: [[COPY:%[0-9]+]]:gprb(p0) = COPY $x10
    ; RV64I-NEXT: [[PTRTOINT:%[0-9]+]]:gprb(s64) = G_PTRTOINT [[COPY]](p0)
    ; RV64I-NEXT: $x10 = COPY [[PTRTOINT]](s64)
    ; RV64I-NEXT: PseudoRET implicit $x10
    %0:_(p0) = COPY $x10
    %1:_(s64) = G_PTRTOINT %0(p0)
    $x10 = COPY %1(s64)
    PseudoRET implicit $x10

...
---
name:            inttoprt
legalized:       true
tracksRegLiveness: true
body:             |
  bb.0.entry:
    liveins: $x10

    ; RV64I-LABEL: name: inttoprt
    ; RV64I: liveins: $x10
    ; RV64I-NEXT: {{  $}}
    ; RV64I-NEXT: [[COPY:%[0-9]+]]:gprb(s64) = COPY $x10
    ; RV64I-NEXT: [[INTTOPTR:%[0-9]+]]:gprb(p0) = G_INTTOPTR [[COPY]](s64)
    ; RV64I-NEXT: $x10 = COPY [[INTTOPTR]](p0)
    ; RV64I-NEXT: PseudoRET implicit $x10
    %0:_(s64) = COPY $x10
    %1:_(p0) = G_INTTOPTR %0(s64)
    $x10 = COPY %1(p0)
    PseudoRET implicit $x10

...