[PATCH] D157614: [RISCV] Lower reverse shuffles of fixed i1 vectors to vbrev.v

Luke Lau via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 10 06:49:34 PDT 2023


luke created this revision.
luke added reviewers: craig.topper, reames, fakepaper56, 4vtomat.
Herald added subscribers: jobnoorman, asb, pmatos, VincentWu, vkmr, frasercrmck, 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, hiraditya, arichardson.
Herald added a project: All.
luke requested review of this revision.
Herald added subscribers: llvm-commits, wangpc, eopXD, MaskRay.
Herald added a project: LLVM.

If we can fit an entire vector of i1 into a single element, e.g. v32i1 ->
v1i32, then we can reverse it via vbrev.v.
We need to handle the case where the vector doesn't exactly fit into the larger
element type, e.g. v4i1 -> v1i8. In this case we shift up the reversed bits
afterwards.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D157614

Files:
  llvm/lib/Target/RISCV/RISCVISelLowering.cpp
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-shuffle-reverse.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D157614.549023.patch
Type: text/x-patch
Size: 12790 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230810/68f6455b/attachment.bin>


More information about the llvm-commits mailing list