[PATCH] D146711: [RISCV] Lower shuffles as vmerge + vslide{up,down} where possible

Luke Lau via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 23 04:14:00 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, hiraditya, 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.

Currently, shuffles are lowered as selects if each destination element
is choosing between either source vector's element at the same index.
This extends the logic to allow the source vectors to be slid up or down
before merging.

For example,
shufflevector <4 x i8> v1, <4 x i8> v2, <0, 1, 4, 5>
can be expressed as
select v1, (slideup v2, 2), <0, 0, 1, 1>

This pattern shows up with shuffles that insert subvectors
(SK_InsertSubvector)


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D146711

Files:
  llvm/lib/Target/RISCV/RISCVISelLowering.cpp
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-int-shuffles.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-shufflevector-vnsrl.ll
  llvm/test/CodeGen/RISCV/rvv/vector-deinterleave-fixed.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146711.507689.patch
Type: text/x-patch
Size: 15672 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230323/743093ef/attachment.bin>


More information about the llvm-commits mailing list