Skip to content

Commit 1c90218

Browse files
fixup! fix vmv.v.v test
1 parent 9510c6a commit 1c90218

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

llvm/test/CodeGen/RISCV/rvv/vl-opt-instrs.ll

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1948,21 +1948,26 @@ define <vscale x 4 x i32> @vmv_v_i(<vscale x 4 x i32> %a, i32 %x, iXLen %vl) {
19481948
ret <vscale x 4 x i32> %2
19491949
}
19501950

1951-
define <vscale x 4 x i32> @vmv_v_v(<vscale x 4 x i32> %a, <vscale x 4 x i32> %v, iXLen %vl) {
1952-
; NOVLOPT-LABEL: vmv_v_v:
1951+
; The vmv.v.v is optimized away if we use a vadd as the user.
1952+
define <vscale x 1 x i8> @vmv_v_v(<vscale x 1 x i8> %a, i8 %b, <vscale x 1 x i8> %c, <vscale x 1 x i1> %m, iXLen %vl) {
1953+
; NOVLOPT-LABEL: vmerge_vvm:
19531954
; NOVLOPT: # %bb.0:
1954-
; NOVLOPT-NEXT: vsetvli zero, a0, e32, m2, ta, ma
1955-
; NOVLOPT-NEXT: vadd.vv v8, v10, v8
1955+
; NOVLOPT-NEXT: vsetvli a2, zero, e8, mf8, tu, ma
1956+
; NOVLOPT-NEXT: vmv.v.x v8, a0
1957+
; NOVLOPT-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
1958+
; NOVLOPT-NEXT: vmerge.vvm v8, v8, v9, v0
19561959
; NOVLOPT-NEXT: ret
19571960
;
1958-
; VLOPT-LABEL: vmv_v_v:
1961+
; VLOPT-LABEL: vmerge_vvm:
19591962
; VLOPT: # %bb.0:
1960-
; VLOPT-NEXT: vsetvli zero, a0, e32, m2, ta, ma
1961-
; VLOPT-NEXT: vadd.vv v8, v10, v8
1963+
; VLOPT-NEXT: vsetvli zero, a1, e8, mf8, tu, ma
1964+
; VLOPT-NEXT: vmv.v.x v8, a0
1965+
; VLOPT-NEXT: vsetvli zero, zero, e8, mf8, ta, ma
1966+
; VLOPT-NEXT: vmerge.vvm v8, v8, v9, v0
19621967
; VLOPT-NEXT: ret
1963-
%1 = call <vscale x 4 x i32> @llvm.riscv.vmv.v.v.nxv4i32(<vscale x 4 x i32> poison, <vscale x 4 x i32> %v, iXLen -1)
1964-
%2 = call <vscale x 4 x i32> @llvm.riscv.vadd.nxv4i32.nxv4i32(<vscale x 4 x i32> poison, <vscale x 4 x i32> %1, <vscale x 4 x i32> %a, iXLen %vl)
1965-
ret <vscale x 4 x i32> %2
1968+
%2 = call <vscale x 1 x i8> @llvm.riscv.vmv.v.x.nxv1i8(<vscale x 1 x i8> %a, i8 %b, iXLen -1)
1969+
%3 = call <vscale x 1 x i8> @llvm.riscv.vmerge.nxv1i8.nxv1i8(<vscale x 1 x i8> undef, <vscale x 1 x i8> %2, <vscale x 1 x i8> %c, <vscale x 1 x i1> %m, iXLen %vl)
1970+
ret <vscale x 1 x i8> %3
19661971
}
19671972

19681973
define <vscale x 4 x i32> @vmv_v_x(<vscale x 4 x i32> %a, i32 %x, iXLen %vl) {

0 commit comments

Comments
 (0)