Skip to content

Commit 844fd12

Browse files
fixup! add test for source operand
1 parent 9045979 commit 844fd12

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1269,6 +1269,27 @@ define <vscale x 4 x i32> @vmacc_vv(<vscale x 4 x i32> %a, <vscale x 4 x i32> %b
12691269
ret <vscale x 4 x i32> %2
12701270
}
12711271

1272+
define <vscale x 4 x i32> @vmacc_vv_use(<vscale x 4 x i32> %a, <vscale x 4 x i32> %b, iXLen %vl) {
1273+
; NOVLOPT-LABEL: vmacc_vv_use:
1274+
; NOVLOPT: # %bb.0:
1275+
; NOVLOPT-NEXT: vsetvli a1, zero, e32, m2, ta, ma
1276+
; NOVLOPT-NEXT: vmul.vv v12, v8, v10
1277+
; NOVLOPT-NEXT: vsetvli zero, a0, e32, m2, tu, ma
1278+
; NOVLOPT-NEXT: vmacc.vv v8, v12, v10
1279+
; NOVLOPT-NEXT: ret
1280+
;
1281+
; VLOPT-LABEL: vmacc_vv_use:
1282+
; VLOPT: # %bb.0:
1283+
; VLOPT-NEXT: vsetvli zero, a0, e32, m2, ta, ma
1284+
; VLOPT-NEXT: vmul.vv v12, v8, v10
1285+
; VLOPT-NEXT: vsetvli zero, zero, e32, m2, tu, ma
1286+
; VLOPT-NEXT: vmacc.vv v8, v12, v10
1287+
; VLOPT-NEXT: ret
1288+
%1 = call <vscale x 4 x i32> @llvm.riscv.vmul.nxv4i32.nxv4i32(<vscale x 4 x i32> poison, <vscale x 4 x i32> %a, <vscale x 4 x i32> %b, iXLen -1)
1289+
%2 = call <vscale x 4 x i32> @llvm.riscv.vmacc.nxv4i32.nxv4i32(<vscale x 4 x i32> %a, <vscale x 4 x i32> %1, <vscale x 4 x i32> %b, iXLen %vl, iXLen 0)
1290+
ret <vscale x 4 x i32> %2
1291+
}
1292+
12721293
define <vscale x 4 x i32> @vmacc_vx(<vscale x 4 x i32> %a, i32 %b, iXLen %vl) {
12731294
; NOVLOPT-LABEL: vmacc_vx:
12741295
; NOVLOPT: # %bb.0:

0 commit comments

Comments
 (0)