You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: llvm/test/CodeGen/RISCV/rvv/vl-opt-instrs.ll
+15-10Lines changed: 15 additions & 10 deletions
Original file line number
Diff line number
Diff 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) {
1948
1948
ret <vscale x 4 x i32> %2
1949
1949
}
1950
1950
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:
1953
1954
; 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
1956
1959
; NOVLOPT-NEXT: ret
1957
1960
;
1958
-
; VLOPT-LABEL: vmv_v_v:
1961
+
; VLOPT-LABEL: vmerge_vvm:
1959
1962
; 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
1962
1967
; 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
1966
1971
}
1967
1972
1968
1973
define <vscale x 4 x i32> @vmv_v_x(<vscale x 4 x i32> %a, i32%x, iXLen %vl) {
0 commit comments