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
[RISCV] Merge vmerge into its ops if both masks are the same
We currently only allow a vmerge to be merged into its ops if the op isn't
masked or if the vmerge has an all ones mask. We can extend this to also allow
cases where they share the same mask.
Copy file name to clipboardExpand all lines: llvm/test/CodeGen/RISCV/rvv/rvv-peephole-vmerge-masked-vops.ll
+4-8Lines changed: 4 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -22,10 +22,8 @@ declare <vscale x 2 x i32> @llvm.riscv.vadd.mask.nxv2i32.nxv2i32(<vscale x 2 x i
22
22
define <vscale x 2 x i32> @vmerge_vadd_same_mask(<vscale x 2 x i32> %passthru, <vscale x 2 x i32> %x, <vscale x 2 x i32> %y, <vscale x 2 x i1> %m, i64%vl) {
23
23
; CHECK-LABEL: vmerge_vadd_same_mask:
24
24
; CHECK: # %bb.0:
25
-
; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
26
-
; CHECK-NEXT: vadd.vv v9, v9, v10, v0.t
27
-
; CHECK-NEXT: vsetvli zero, zero, e32, m1, tu, ma
28
-
; CHECK-NEXT: vmerge.vvm v8, v8, v9, v0
25
+
; CHECK-NEXT: vsetvli zero, a0, e32, m1, tu, mu
26
+
; CHECK-NEXT: vadd.vv v8, v9, v10, v0.t
29
27
; CHECK-NEXT: ret
30
28
%a = call <vscale x 2 x i32> @llvm.riscv.vadd.mask.nxv2i32.nxv2i32(<vscale x 2 x i32> poison, <vscale x 2 x i32> %x, <vscale x 2 x i32> %y, <vscale x 2 x i1> %m, i64%vl, i640)
31
29
%b = call <vscale x 2 x i32> @llvm.riscv.vmerge.nxv2i32.nxv2i32(<vscale x 2 x i32> %passthru, <vscale x 2 x i32> %passthru, <vscale x 2 x i32> %a, <vscale x 2 x i1> %m, i64%vl)
@@ -278,10 +276,8 @@ declare <vscale x 2 x i32> @llvm.vp.add.nxv2i32(<vscale x 2 x i32>, <vscale x 2
278
276
define <vscale x 2 x i32> @vmerge_vadd(<vscale x 2 x i32> %passthru, <vscale x 2 x i32> %x, <vscale x 2 x i32> %y, <vscale x 2 x i1> %m, i32zeroext%evl) {
279
277
; CHECK-LABEL: vmerge_vadd:
280
278
; CHECK: # %bb.0:
281
-
; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
282
-
; CHECK-NEXT: vadd.vv v9, v9, v10, v0.t
283
-
; CHECK-NEXT: vsetvli zero, zero, e32, m1, tu, ma
284
-
; CHECK-NEXT: vmerge.vvm v8, v8, v9, v0
279
+
; CHECK-NEXT: vsetvli zero, a0, e32, m1, tu, mu
280
+
; CHECK-NEXT: vadd.vv v8, v9, v10, v0.t
285
281
; CHECK-NEXT: ret
286
282
%1 = call <vscale x 2 x i32> @llvm.vp.add.nxv2i32(<vscale x 2 x i32> %x, <vscale x 2 x i32> %y, <vscale x 2 x i1> %m, i32%evl)
287
283
%2 = call <vscale x 2 x i32> @llvm.vp.merge.nxv2i32(<vscale x 2 x i1> %m, <vscale x 2 x i32> %1, <vscale x 2 x i32> %passthru, i32%evl)
Copy file name to clipboardExpand all lines: llvm/test/CodeGen/RISCV/rvv/vfwmacc-vp.ll
+2-5Lines changed: 2 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -89,11 +89,8 @@ define <vscale x 1 x float> @vfmacc_vv_nxv1f32_tu(<vscale x 1 x half> %a, <vscal
89
89
define <vscale x 1 x float> @vfmacc_vv_nxv1f32_masked__tu(<vscale x 1 x half> %a, <vscale x 1 x half> %b, <vscale x 1 x float> %c, <vscale x 1 x i1> %m, i32zeroext%evl) {
0 commit comments