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] Add test for strided gather with recursive disjoint or. NFC
This already gets converted to a strided intrinsic because we currently call
haveNoCommonBitsSet when checking or instructions, but an upcoming patch will
change this logic and we want to preserve this case.
Note that this IR is in the form that comes from instcombine. The splats need
to be inline constexprs, otherwise isSplatValue() will fail. (It can't
currently handle splats where the shufflevector is an instruction, and the
insertelement is a constexpr.
; CHECK-NEXT: [[GATHER:%.*]] = call <vscale x 1 x i64> @llvm.riscv.masked.strided.load.nxv1i64.p0.i64(<vscale x 1 x i64> poison, ptr [[TMP0]], i64 16, <vscale x 1 x i1> shufflevector (<vscale x 1 x i1> insertelement (<vscale x 1 x i1> poison, i1 true, i32 0), <vscale x 1 x i1> poison, <vscale x 1 x i32> zeroinitializer))
63
+
; CHECK-NEXT: [[ACCUM_NEXT]] = add <vscale x 1 x i64> [[ACCUM]], [[GATHER]]
; CHECK-NEXT: ret <vscale x 1 x i64> [[ACCUM_NEXT]]
70
+
;
71
+
vector.ph:
72
+
%vscale = calli64@llvm.vscale.i64()
73
+
%step = tailcall <vscale x 1 x i64> @llvm.experimental.stepvector.nxv1i64()
74
+
%step.mul2 = shl <vscale x 1 x i64> %step, shufflevector(<vscale x 1 x i64> insertelement(<vscale x 1 x i64> poison, i641, i320), <vscale x 1 x i64> poison, <vscale x 1 x i32> zeroinitializer)
%vec.ind = phi <vscale x 1 x i64> [ %step.mul2, %vector.ph ], [ %vec.ind.next, %vector.body ]
80
+
81
+
%accum = phi <vscale x 1 x i64> [ zeroinitializer, %vector.ph ], [ %accum.next, %vector.body ]
82
+
83
+
%vec.ind.or = or disjoint <vscale x 1 x i64> %vec.ind, shufflevector(<vscale x 1 x i64> insertelement(<vscale x 1 x i64> poison, i641, i640), <vscale x 1 x i64> poison, <vscale x 1 x i32> zeroinitializer)
84
+
85
+
%gep = getelementptri64, ptr%a, <vscale x 1 x i64> %vec.ind.or
86
+
%gather = call <vscale x 1 x i64> @llvm.masked.gather.nxv1i64.nxv1p0(
87
+
<vscale x 1 x ptr> %gep,
88
+
i328,
89
+
<vscale x 1 x i1> shufflevector (<vscale x 1 x i1> insertelement (<vscale x 1 x i1> poison, i1true, i320), <vscale x 1 x i1> poison, <vscale x 1 x i32> zeroinitializer),
90
+
<vscale x 1 x i64> poison
91
+
)
92
+
93
+
%accum.next = add <vscale x 1 x i64> %accum, %gather
94
+
%index.next = addnuwi64%index, %vscale
95
+
%vec.ind.next = add <vscale x 1 x i64> %vec.ind, shufflevector(<vscale x 1 x i64> insertelement(<vscale x 1 x i64> poison, i642, i640), <vscale x 1 x i64> poison, <vscale x 1 x i32> zeroinitializer)
0 commit comments