llvm/llvm/test/CodeGen/RISCV/rvv/rvv-peephole-vmerge-to-vmv.mir

# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 3
# RUN: llc %s -o - -mtriple=riscv64 -mattr=+v -run-pass=riscv-vector-peephole \
# RUN:     -verify-machineinstrs | FileCheck %s

---
name: undef_passthru
body: |
  bb.0:
    liveins: $x1, $v8, $v9
    ; CHECK-LABEL: name: undef_passthru
    ; CHECK: liveins: $x1, $v8, $v9
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: %false:vr = COPY $v8
    ; CHECK-NEXT: %true:vr = COPY $v9
    ; CHECK-NEXT: %avl:gprnox0 = COPY $x1
    ; CHECK-NEXT: %mask:vmv0 = PseudoVMSET_M_B8 %avl, 5 /* e32 */
    ; CHECK-NEXT: $v0 = COPY %mask
    ; CHECK-NEXT: %x:vr = PseudoVMV_V_V_M1 $noreg, %true, %avl, 5 /* e32 */, 0 /* tu, mu */
    %false:vr = COPY $v8
    %true:vr = COPY $v9
    %avl:gprnox0 = COPY $x1
    %mask:vmv0 = PseudoVMSET_M_B8 %avl, 5
    $v0 = COPY %mask
    %x:vrnov0 = PseudoVMERGE_VVM_M1 $noreg, %false, %true, $v0, %avl, 5
...
---
name: undef_false
body: |
  bb.0:
    liveins: $x1, $v8, $v9
    ; CHECK-LABEL: name: undef_false
    ; CHECK: liveins: $x1, $v8, $v9
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: %pt:vr = COPY $v8
    ; CHECK-NEXT: %false:vr = COPY $noreg
    ; CHECK-NEXT: %true:vr = COPY $v9
    ; CHECK-NEXT: %avl:gprnox0 = COPY $x1
    ; CHECK-NEXT: %mask:vmv0 = PseudoVMSET_M_B8 %avl, 5 /* e32 */
    ; CHECK-NEXT: $v0 = COPY %mask
    ; CHECK-NEXT: %x:vr = PseudoVMV_V_V_M1 %pt, %true, %avl, 5 /* e32 */, 0 /* tu, mu */
    %pt:vrnov0 = COPY $v8
    %false:vr = COPY $noreg
    %true:vr = COPY $v9
    %avl:gprnox0 = COPY $x1
    %mask:vmv0 = PseudoVMSET_M_B8 %avl, 5
    $v0 = COPY %mask
    %x:vrnov0 = PseudoVMERGE_VVM_M1 %pt, %false, %true, $v0, %avl, 5
...
---
name: equal_passthru_false
body: |
  bb.0:
    liveins: $x1, $v8, $v9
    ; CHECK-LABEL: name: equal_passthru_false
    ; CHECK: liveins: $x1, $v8, $v9
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: %false:vr = COPY $v8
    ; CHECK-NEXT: %pt:vr = COPY $v8
    ; CHECK-NEXT: %true:vr = COPY $v9
    ; CHECK-NEXT: %avl:gprnox0 = COPY $x1
    ; CHECK-NEXT: %mask:vmv0 = PseudoVMSET_M_B8 %avl, 5 /* e32 */
    ; CHECK-NEXT: $v0 = COPY %mask
    ; CHECK-NEXT: %x:vr = PseudoVMV_V_V_M1 %pt, %true, %avl, 5 /* e32 */, 0 /* tu, mu */
    %false:vr = COPY $v8
    %pt:vrnov0 = COPY $v8
    %true:vr = COPY $v9
    %avl:gprnox0 = COPY $x1
    %mask:vmv0 = PseudoVMSET_M_B8 %avl, 5
    $v0 = COPY %mask
    %x:vrnov0 = PseudoVMERGE_VVM_M1 %pt, %false, %true, $v0, %avl, 5
...