[PATCH] D146626: [RISCV] Add test case for combining vrgather
Luke Lau via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 22 06:07:03 PDT 2023
luke created this revision.
luke added reviewers: craig.topper, reames, fakepaper56.
Herald added subscribers: jobnoorman, asb, pmatos, VincentWu, vkmr, frasercrmck, evandro, luismarques, apazos, sameer.abuasal, s.egerton, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, shiva0217, kito-cheng, niosHD, sabuasal, simoncook, johnrusso, rbar, arichardson.
Herald added a project: All.
luke requested review of this revision.
Herald added subscribers: llvm-commits, pcwang-thead, eopXD, MaskRay.
Herald added a project: LLVM.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D146626
Files:
llvm/test/CodeGen/RISCV/rvv/combine-gather.ll
Index: llvm/test/CodeGen/RISCV/rvv/combine-gather.ll
===================================================================
--- /dev/null
+++ llvm/test/CodeGen/RISCV/rvv/combine-gather.ll
@@ -0,0 +1,21 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
+; RUN: llc -mtriple=riscv32 -mattr=+v < %s | FileCheck %s
+; RUN: llc -mtriple=riscv64 -mattr=+v < %s | FileCheck %s
+
+; FIXME: There should only be one vrgather here
+
+define <8 x i8> @gather_i8(<8 x i8> %v, <8 x i8> %w) {
+; CHECK-LABEL: gather_i8:
+; CHECK: # %bb.0:
+; CHECK-NEXT: vsetivli zero, 8, e8, mf2, ta, mu
+; CHECK-NEXT: vid.v v11
+; CHECK-NEXT: vrgather.vv v10, v8, v11
+; CHECK-NEXT: li a0, 240
+; CHECK-NEXT: vmv.s.x v0, a0
+; CHECK-NEXT: vadd.vi v8, v11, -4
+; CHECK-NEXT: vrgather.vv v10, v9, v8, v0.t
+; CHECK-NEXT: vmv1r.v v8, v10
+; CHECK-NEXT: ret
+ %res = shufflevector <8 x i8> %v, <8 x i8> %w, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 8, i32 9, i32 10, i32 11>
+ ret <8 x i8> %res
+}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146626.507331.patch
Type: text/x-patch
Size: 1052 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230322/28d56c65/attachment.bin>
More information about the llvm-commits
mailing list