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
; CHECK-NEXT: [[VEC_IND:%.*]] = phi <vscale x 1 x i64> [ [[TMP0]], [[VECTOR_PH]] ], [ [[VEC_IND_NEXT:%.*]], [[VECTOR_BODY]] ]
117
+
; CHECK-NEXT: [[ACCUM:%.*]] = phi <vscale x 1 x i64> [ zeroinitializer, [[VECTOR_PH]] ], [ [[ACCUM_NEXT:%.*]], [[VECTOR_BODY]] ]
118
+
; CHECK-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[STRUCT_FOO:%.*]], ptr [[A:%.*]], <vscale x 1 x i64> [[VEC_IND]], i32 3
119
+
; CHECK-NEXT: [[GATHER:%.*]] = call <vscale x 1 x i64> @llvm.masked.gather.nxv1i64.nxv1p0(<vscale x 1 x ptr> [[TMP1]], i32 8, <vscale x 1 x i1> splat (i1 true), <vscale x 1 x i64> undef)
120
+
; CHECK-NEXT: [[ACCUM_NEXT]] = add <vscale x 1 x i64> [[ACCUM]], [[GATHER]]
%vec.ind = phi <vscale x 1 x i64> [ %1, %vector.ph ], [ %vec.ind.next, %vector.body ]
140
+
%accum = phi <vscale x 1 x i64> [ zeroinitializer, %vector.ph ], [ %accum.next, %vector.body ]
141
+
%2 = getelementptrinbounds%struct.foo, ptr%a, <vscale x 1 x i64> %vec.ind, i323
142
+
%gather = call <vscale x 1 x i64> @llvm.masked.gather.nxv1i64.nxv1p0(<vscale x 1 x ptr> %2, i328, <vscale x 1 x i1> splat (i1true), <vscale x 1 x i64> undef)
143
+
%accum.next = add <vscale x 1 x i64> %accum, %gather
144
+
145
+
%b.gep = getelementptri64, ptr%b, i64%index
146
+
%step = loadi64, ptr%b.gep
147
+
%index.next = addnuwi64%index, %step
148
+
%.splatinsert = insertelement <vscale x 1 x i64> poison, i64%step, i640
149
+
%.splat = shufflevector <vscale x 1 x i64> %.splatinsert, <vscale x 1 x i64> poison, <vscale x 1 x i32> zeroinitializer
150
+
%vec.ind.next = add <vscale x 1 x i64> %vec.ind, %.splat
151
+
%3 = icmpnei64%index.next, %wide.trip.count
152
+
bri1%3, label%for.cond.cleanup, label%vector.body
153
+
154
+
for.cond.cleanup: ; preds = %vector.body
155
+
ret <vscale x 1 x i64> %accum.next
156
+
}
157
+
158
+
define <vscale x 1 x i64> @gather_non_invariant_step_shl(ptr%a, ptr%b, i32%len) {
159
+
; CHECK-LABEL: @gather_non_invariant_step_shl(
160
+
; CHECK-NEXT: vector.ph:
161
+
; CHECK-NEXT: [[WIDE_TRIP_COUNT:%.*]] = zext i32 [[LEN:%.*]] to i64
162
+
; CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 1 x i64> @llvm.stepvector.nxv1i64()
; CHECK-NEXT: [[VEC_IND:%.*]] = phi <vscale x 1 x i64> [ [[TMP0]], [[VECTOR_PH]] ], [ [[VEC_IND_NEXT:%.*]], [[VECTOR_BODY]] ]
167
+
; CHECK-NEXT: [[ACCUM:%.*]] = phi <vscale x 1 x i64> [ zeroinitializer, [[VECTOR_PH]] ], [ [[ACCUM_NEXT:%.*]], [[VECTOR_BODY]] ]
168
+
; CHECK-NEXT: [[VEC_IND_ADD:%.*]] = add <vscale x 1 x i64> [[VEC_IND]], splat (i64 42)
169
+
; CHECK-NEXT: [[VEC_IND_SHL:%.*]] = shl <vscale x 1 x i64> [[VEC_IND_ADD]], splat (i64 2)
170
+
; CHECK-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[STRUCT_FOO:%.*]], ptr [[A:%.*]], <vscale x 1 x i64> [[VEC_IND_SHL]], i32 3
171
+
; CHECK-NEXT: [[GATHER:%.*]] = call <vscale x 1 x i64> @llvm.masked.gather.nxv1i64.nxv1p0(<vscale x 1 x ptr> [[TMP1]], i32 8, <vscale x 1 x i1> splat (i1 true), <vscale x 1 x i64> undef)
172
+
; CHECK-NEXT: [[ACCUM_NEXT]] = add <vscale x 1 x i64> [[ACCUM]], [[GATHER]]
%vec.ind = phi <vscale x 1 x i64> [ %1, %vector.ph ], [ %vec.ind.next, %vector.body ]
192
+
%accum = phi <vscale x 1 x i64> [ zeroinitializer, %vector.ph ], [ %accum.next, %vector.body ]
193
+
194
+
%vec.ind.add = add <vscale x 1 x i64> %vec.ind, splat (i6442)
195
+
%vec.ind.shl = shl <vscale x 1 x i64> %vec.ind.add, splat (i642)
196
+
197
+
%2 = getelementptrinbounds%struct.foo, ptr%a, <vscale x 1 x i64> %vec.ind.shl, i323
198
+
%gather = call <vscale x 1 x i64> @llvm.masked.gather.nxv1i64.nxv1p0(<vscale x 1 x ptr> %2, i328, <vscale x 1 x i1> splat (i1true), <vscale x 1 x i64> undef)
199
+
%accum.next = add <vscale x 1 x i64> %accum, %gather
200
+
201
+
%b.gep = getelementptri64, ptr%b, i64%index
202
+
%step = loadi64, ptr%b.gep
203
+
%index.next = addnuwi64%index, %step
204
+
%.splatinsert = insertelement <vscale x 1 x i64> poison, i64%step, i640
205
+
%.splat = shufflevector <vscale x 1 x i64> %.splatinsert, <vscale x 1 x i64> poison, <vscale x 1 x i32> zeroinitializer
206
+
%vec.ind.next = add <vscale x 1 x i64> %vec.ind, %.splat
; CHECK-NEXT: [[VEC_IND:%.*]] = phi <vscale x 1 x i64> [ [[TMP0]], [[VECTOR_PH]] ], [ [[VEC_IND_NEXT:%.*]], [[VECTOR_BODY]] ]
264
+
; CHECK-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[STRUCT_FOO:%.*]], ptr [[A:%.*]], <vscale x 1 x i64> [[VEC_IND]], i32 3
265
+
; CHECK-NEXT: tail call void @llvm.masked.scatter.nxv1i64.nxv1p0(<vscale x 1 x i64> zeroinitializer, <vscale x 1 x ptr> [[TMP1]], i32 8, <vscale x 1 x i1> splat (i1 true))
; CHECK-NEXT: [[VEC_IND:%.*]] = phi <vscale x 1 x i64> [ [[TMP0]], [[VECTOR_PH]] ], [ [[VEC_IND_NEXT:%.*]], [[VECTOR_BODY]] ]
310
+
; CHECK-NEXT: [[VEC_IND_ADD:%.*]] = add <vscale x 1 x i64> [[VEC_IND]], splat (i64 42)
311
+
; CHECK-NEXT: [[VEC_IND_SHL:%.*]] = shl <vscale x 1 x i64> [[VEC_IND_ADD]], splat (i64 2)
312
+
; CHECK-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[STRUCT_FOO:%.*]], ptr [[A:%.*]], <vscale x 1 x i64> [[VEC_IND_SHL]], i32 3
313
+
; CHECK-NEXT: tail call void @llvm.masked.scatter.nxv1i64.nxv1p0(<vscale x 1 x i64> zeroinitializer, <vscale x 1 x ptr> [[TMP1]], i32 8, <vscale x 1 x i1> splat (i1 true))
; CHECK-NEXT: [[TMP2:%.*]] = getelementptr inbounds [[STRUCT_FOO:%.*]], ptr [[A:%.*]], <vscale x 1 x i64> [[VEC_IND]], i32 3
503
-
; CHECK-NEXT: [[GATHER:%.*]] = call <vscale x 1 x i64> @llvm.vp.gather.nxv1i64.nxv1p0(<vscale x 1 x ptr> [[TMP2]], <vscale x 1 x i1> splat (i1 true), i32 [[EVL]])
706
+
; CHECK-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[STRUCT_FOO:%.*]], ptr [[A:%.*]], <vscale x 1 x i64> [[VEC_IND]], i32 3
707
+
; CHECK-NEXT: [[GATHER:%.*]] = call <vscale x 1 x i64> @llvm.vp.gather.nxv1i64.nxv1p0(<vscale x 1 x ptr> [[TMP1]], <vscale x 1 x i1> splat (i1 true), i32 [[EVL]])
504
708
; CHECK-NEXT: [[ACCUM_NEXT]] = add <vscale x 1 x i64> [[ACCUM]], [[GATHER]]
505
709
; CHECK-NEXT: [[EVL_ZEXT:%.*]] = zext i32 [[EVL]] to i64
; CHECK-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[STRUCT_FOO:%.*]], ptr [[A:%.*]], <vscale x 1 x i64> [[VEC_IND]], i32 3
559
763
; CHECK-NEXT: tail call void @llvm.vp.scatter.nxv1i64.nxv1p0(<vscale x 1 x i64> zeroinitializer, <vscale x 1 x ptr> [[TMP1]], <vscale x 1 x i1> splat (i1 true), i32 [[EVL]])
560
764
; CHECK-NEXT: [[EVL_ZEXT:%.*]] = zext i32 [[EVL]] to i64
0 commit comments