Skip to content

Commit f48ed13

Browse files
fixup! add test for source operand
1 parent 24d86e8 commit f48ed13

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
@@ -1143,6 +1143,27 @@ define <vscale x 4 x i32> @vmacc_vv(<vscale x 4 x i32> %a, <vscale x 4 x i32> %b
11431143
ret <vscale x 4 x i32> %2
11441144
}
11451145

1146+
define <vscale x 4 x i32> @vmacc_vv_use(<vscale x 4 x i32> %a, <vscale x 4 x i32> %b, iXLen %vl) {
1147+
; NOVLOPT-LABEL: vmacc_vv_use:
1148+
; NOVLOPT: # %bb.0:
1149+
; NOVLOPT-NEXT: vsetvli a1, zero, e32, m2, ta, ma
1150+
; NOVLOPT-NEXT: vmul.vv v12, v8, v10
1151+
; NOVLOPT-NEXT: vsetvli zero, a0, e32, m2, tu, ma
1152+
; NOVLOPT-NEXT: vmacc.vv v8, v12, v10
1153+
; NOVLOPT-NEXT: ret
1154+
;
1155+
; VLOPT-LABEL: vmacc_vv_use:
1156+
; VLOPT: # %bb.0:
1157+
; VLOPT-NEXT: vsetvli zero, a0, e32, m2, ta, ma
1158+
; VLOPT-NEXT: vmul.vv v12, v8, v10
1159+
; VLOPT-NEXT: vsetvli zero, zero, e32, m2, tu, ma
1160+
; VLOPT-NEXT: vmacc.vv v8, v12, v10
1161+
; VLOPT-NEXT: ret
1162+
%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)
1163+
%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)
1164+
ret <vscale x 4 x i32> %2
1165+
}
1166+
11461167
define <vscale x 4 x i32> @vmacc_vx(<vscale x 4 x i32> %a, i32 %b, iXLen %vl) {
11471168
; NOVLOPT-LABEL: vmacc_vx:
11481169
; NOVLOPT: # %bb.0:

0 commit comments

Comments
 (0)