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
Copy file name to clipboardExpand all lines: llvm/test/CodeGen/RISCV/rvv/strided-load-store.ll
+60Lines changed: 60 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -319,6 +319,66 @@ define <vscale x 1 x i64> @vector_base_scalar_offset(ptr %p, i64 %offset) {
319
319
ret <vscale x 1 x i64> %x
320
320
}
321
321
322
+
define <vscale x 1 x i64> @splat_base_scalar_offset(ptr%p, i64%offset) {
323
+
; CHECK-LABEL: @splat_base_scalar_offset(
324
+
; CHECK-NEXT: [[HEAD:%.*]] = insertelement <vscale x 1 x ptr> poison, ptr [[P:%.*]], i32 0
325
+
; CHECK-NEXT: [[SPLAT:%.*]] = shufflevector <vscale x 1 x ptr> [[HEAD]], <vscale x 1 x ptr> poison, <vscale x 1 x i32> zeroinitializer
326
+
; CHECK-NEXT: [[PTRS:%.*]] = getelementptr i64, <vscale x 1 x ptr> [[SPLAT]], i64 [[OFFSET:%.*]]
327
+
; CHECK-NEXT: [[X:%.*]] = call <vscale x 1 x i64> @llvm.masked.gather.nxv1i64.nxv1p0(<vscale x 1 x ptr> [[PTRS]], i32 8, <vscale x 1 x i1> shufflevector (<vscale x 1 x i1> insertelement (<vscale x 1 x i1> poison, i1 true, i64 0), <vscale x 1 x i1> poison, <vscale x 1 x i32> zeroinitializer), <vscale x 1 x i64> poison)
328
+
; CHECK-NEXT: ret <vscale x 1 x i64> [[X]]
329
+
;
330
+
%head = insertelement <vscale x 1 x ptr> poison, ptr%p, i320
331
+
%splat = shufflevector <vscale x 1 x ptr> %head, <vscale x 1 x ptr> poison, <vscale x 1 x i32> zeroinitializer
332
+
%ptrs = getelementptri64, <vscale x 1 x ptr> %splat, i64%offset
333
+
%x = call <vscale x 1 x i64> @llvm.masked.gather.nxv1i64.nxv1p0(
334
+
<vscale x 1 x ptr> %ptrs,
335
+
i328,
336
+
<vscale x 1 x i1> splat (i11),
337
+
<vscale x 1 x i64> poison
338
+
)
339
+
ret <vscale x 1 x i64> %x
340
+
}
341
+
342
+
; We shouldn't be able to determine a stride here.
343
+
define <vscale x 1 x i64> @nonstrided_base_scalar_offset(ptr%p, <vscale x 1 x i64> %v, i64%offset) {
344
+
; CHECK-LABEL: @nonstrided_base_scalar_offset(
345
+
; CHECK-NEXT: [[PTRS1:%.*]] = getelementptr i64, ptr [[P:%.*]], <vscale x 1 x i64> [[V:%.*]]
346
+
; CHECK-NEXT: [[PTRS2:%.*]] = getelementptr i64, <vscale x 1 x ptr> [[PTRS1]], i64 [[OFFSET:%.*]]
347
+
; CHECK-NEXT: [[X:%.*]] = call <vscale x 1 x i64> @llvm.masked.gather.nxv1i64.nxv1p0(<vscale x 1 x ptr> [[PTRS2]], i32 8, <vscale x 1 x i1> shufflevector (<vscale x 1 x i1> insertelement (<vscale x 1 x i1> poison, i1 true, i64 0), <vscale x 1 x i1> poison, <vscale x 1 x i32> zeroinitializer), <vscale x 1 x i64> poison)
348
+
; CHECK-NEXT: ret <vscale x 1 x i64> [[X]]
349
+
;
350
+
%ptrs1 = getelementptri64, ptr%p, <vscale x 1 x i64> %v
351
+
%ptrs2 = getelementptri64, <vscale x 1 x ptr> %ptrs1, i64%offset
352
+
%x = call <vscale x 1 x i64> @llvm.masked.gather.nxv1i64.nxv1p0(
353
+
<vscale x 1 x ptr> %ptrs2,
354
+
i328,
355
+
<vscale x 1 x i1> splat (i11),
356
+
<vscale x 1 x i64> poison
357
+
)
358
+
ret <vscale x 1 x i64> %x
359
+
}
360
+
361
+
; We shouldn't be able to determine a scalar base here.
362
+
define <vscale x 1 x i64> @vector_base_vector_offset(ptr%p, <vscale x 1 x i64> %offset) {
363
+
; CHECK-LABEL: @vector_base_vector_offset(
364
+
; CHECK-NEXT: [[STEP:%.*]] = call <vscale x 1 x i64> @llvm.experimental.stepvector.nxv1i64()
365
+
; CHECK-NEXT: [[PTRS1:%.*]] = getelementptr i64, ptr [[P:%.*]], <vscale x 1 x i64> [[STEP]]
366
+
; CHECK-NEXT: [[PTRS2:%.*]] = getelementptr i64, <vscale x 1 x ptr> [[PTRS1]], <vscale x 1 x i64> [[OFFSET:%.*]]
367
+
; CHECK-NEXT: [[X:%.*]] = call <vscale x 1 x i64> @llvm.masked.gather.nxv1i64.nxv1p0(<vscale x 1 x ptr> [[PTRS2]], i32 8, <vscale x 1 x i1> shufflevector (<vscale x 1 x i1> insertelement (<vscale x 1 x i1> poison, i1 true, i64 0), <vscale x 1 x i1> poison, <vscale x 1 x i32> zeroinitializer), <vscale x 1 x i64> poison)
368
+
; CHECK-NEXT: ret <vscale x 1 x i64> [[X]]
369
+
;
370
+
%step = call <vscale x 1 x i64> @llvm.experimental.stepvector.nxv1i64()
371
+
%ptrs1 = getelementptri64, ptr%p, <vscale x 1 x i64> %step
372
+
%ptrs2 = getelementptri64, <vscale x 1 x ptr> %ptrs1, <vscale x 1 x i64> %offset
373
+
%x = call <vscale x 1 x i64> @llvm.masked.gather.nxv1i64.nxv1p0(
374
+
<vscale x 1 x ptr> %ptrs2,
375
+
i328,
376
+
<vscale x 1 x i1> splat (i11),
377
+
<vscale x 1 x i64> poison
378
+
)
379
+
ret <vscale x 1 x i64> %x
380
+
}
381
+
322
382
declarei64@llvm.vscale.i64()
323
383
declarevoid@llvm.masked.scatter.nxv1i64.nxv1p0(<vscale x 1 x i64>, <vscale x 1 x ptr>, i32, <vscale x 1 x i1>)
324
384
declare <vscale x 1 x i64> @llvm.masked.gather.nxv1i64.nxv1p0(<vscale x 1 x ptr>, i32, <vscale x 1 x i1>, <vscale x 1 x i64>)
0 commit comments