[llvm] fb87e11 - [RISCV] Add test case for strided scatter with scalar offset. NFC
Luke Lau via llvm-commits
llvm-commits at lists.llvm.org
Fri May 31 07:49:32 PDT 2024
Author: Luke Lau
Date: 2024-05-31T15:49:16+01:00
New Revision: fb87e11e7253656ffe99726f45b679e08343bd5f
URL: https://github.com/llvm/llvm-project/commit/fb87e11e7253656ffe99726f45b679e08343bd5f
DIFF: https://github.com/llvm/llvm-project/commit/fb87e11e7253656ffe99726f45b679e08343bd5f.diff
LOG: [RISCV] Add test case for strided scatter with scalar offset. NFC
Added:
Modified:
llvm/test/CodeGen/RISCV/rvv/strided-load-store.ll
Removed:
################################################################################
diff --git a/llvm/test/CodeGen/RISCV/rvv/strided-load-store.ll b/llvm/test/CodeGen/RISCV/rvv/strided-load-store.ll
index 7047c482c1895..4feecbbdef94f 100644
--- a/llvm/test/CodeGen/RISCV/rvv/strided-load-store.ll
+++ b/llvm/test/CodeGen/RISCV/rvv/strided-load-store.ll
@@ -299,6 +299,26 @@ define void @constant_stride(<vscale x 1 x i64> %x, ptr %p, i64 %stride) {
ret void
}
+define <vscale x 1 x i64> @vector_base_scalar_offset(ptr %p, i64 %offset) {
+; CHECK-LABEL: @vector_base_scalar_offset(
+; CHECK-NEXT: [[STEP:%.*]] = call <vscale x 1 x i64> @llvm.experimental.stepvector.nxv1i64()
+; CHECK-NEXT: [[PTRS1:%.*]] = getelementptr i64, ptr [[P:%.*]], <vscale x 1 x i64> [[STEP]]
+; CHECK-NEXT: [[PTRS2:%.*]] = getelementptr i64, <vscale x 1 x ptr> [[PTRS1]], i64 [[OFFSET:%.*]]
+; 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)
+; CHECK-NEXT: ret <vscale x 1 x i64> [[X]]
+;
+ %step = call <vscale x 1 x i64> @llvm.experimental.stepvector.nxv1i64()
+ %ptrs1 = getelementptr i64, ptr %p, <vscale x 1 x i64> %step
+ %ptrs2 = getelementptr i64, <vscale x 1 x ptr> %ptrs1, i64 %offset
+ %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> splat (i1 1),
+ <vscale x 1 x i64> poison
+ )
+ ret <vscale x 1 x i64> %x
+}
+
declare i64 @llvm.vscale.i64()
declare void @llvm.masked.scatter.nxv1i64.nxv1p0(<vscale x 1 x i64>, <vscale x 1 x ptr>, i32, <vscale x 1 x i1>)
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>)
More information about the llvm-commits
mailing list