diff --git a/llvm/test/CodeGen/RISCV/rvv/rvv-peephole-vmerge-vops.ll b/llvm/test/CodeGen/RISCV/rvv/rvv-peephole-vmerge-vops.ll --- a/llvm/test/CodeGen/RISCV/rvv/rvv-peephole-vmerge-vops.ll +++ b/llvm/test/CodeGen/RISCV/rvv/rvv-peephole-vmerge-vops.ll @@ -1065,3 +1065,15 @@ ret %b } +; FIXME: The vadd's new policy should be tail undisturbed since the false op of +; the vmerge moves from the the body to the tail, and we need to preserve it. +define @vmerge_larger_vl_false_becomes_tail( %false, %x, %y, %m) { +; CHECK-LABEL: vmerge_larger_vl_false_becomes_tail: +; CHECK: # %bb.0: +; CHECK-NEXT: vsetivli zero, 2, e32, m1, ta, mu +; CHECK-NEXT: vadd.vv v8, v9, v10, v0.t +; CHECK-NEXT: ret + %a = call @llvm.riscv.vadd.nxv2i32.nxv2i32( poison, %x, %y, i64 2) + %b = call @llvm.riscv.vmerge.nxv2i32.nxv2i32( poison, %false, %a, %m, i64 3) + ret %b +}