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
DAGCombiner (or InstCombine) will convert an add to an or if the bits are disjoint, which can prevent what was originally an (add {s,z}ext, {s,z}ext) from being selected as a vwadd.
This teaches combineBinOp_VLToVWBinOp_VL to recover it by treating it as an add.
Copy file name to clipboardExpand all lines: llvm/test/CodeGen/RISCV/rvv/vwadd-sdnode.ll
+4-7Lines changed: 4 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -1394,18 +1394,15 @@ define <vscale x 1 x i64> @i1_zext(<vscale x 1 x i1> %va, <vscale x 1 x i64> %vb
1394
1394
}
1395
1395
1396
1396
; %x.i32 and %y.i32 are disjoint, so DAGCombiner will combine it into an or.
1397
-
; FIXME: We should be able to recover the or into vwaddu.vv if the disjoint
1398
-
; flag is set.
1397
+
; Check that we combine disjoint ors into vwaddu.
1399
1398
define <vscale x 2 x i32> @disjoint_or(<vscale x 2 x i8> %x.i8, <vscale x 2 x i8> %y.i8) {
1400
1399
; CHECK-LABEL: disjoint_or:
1401
1400
; CHECK: # %bb.0:
1402
1401
; CHECK-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
1403
1402
; CHECK-NEXT: vzext.vf2 v10, v8
1404
-
; CHECK-NEXT: vsll.vi v8, v10, 8
1405
-
; CHECK-NEXT: vsetvli zero, zero, e32, m1, ta, ma
1406
-
; CHECK-NEXT: vzext.vf2 v10, v8
1407
-
; CHECK-NEXT: vzext.vf4 v8, v9
1408
-
; CHECK-NEXT: vor.vv v8, v10, v8
1403
+
; CHECK-NEXT: vsll.vi v10, v10, 8
1404
+
; CHECK-NEXT: vzext.vf2 v11, v9
1405
+
; CHECK-NEXT: vwaddu.vv v8, v10, v11
1409
1406
; CHECK-NEXT: ret
1410
1407
%x.i16 = zext <vscale x 2 x i8> %x.i8to <vscale x 2 x i16>
1411
1408
%x.shl = shl <vscale x 2 x i16> %x.i16, shufflevector(<vscale x 2 x i16> insertelement(<vscale x 2 x i16> poison, i168, i320), <vscale x 2 x i16> poison, <vscale x 2 x i32> zeroinitializer)
0 commit comments