[PATCH] D155928: [RISCV] Add patterns for vnsrl.vx where shift amount is truncated

Luke Lau via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 21 02:31:55 PDT 2023


luke created this revision.
luke added reviewers: craig.topper, 4vtomat, reames.
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.

Similar to D155698 <https://reviews.llvm.org/D155698> where the shift amount is extended, this patch extends the
ComplexPattern to handle the case where the shift amount has been truncated.
Truncations are custom lowered to truncate_vector_vl, and in cases like i64 ->
i16 they are truncated by one power of two at a time, so we need to unravel
nested layers of them.

The pattern can also be reused for Zvbb's vwsll.vx in an upcoming patch.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D155928

Files:
  llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
  llvm/lib/Target/RISCV/RISCVISelDAGToDAG.h
  llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td
  llvm/test/CodeGen/RISCV/rvv/vnsrl-sdnode.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D155928.542826.patch
Type: text/x-patch
Size: 4599 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230721/d6cf8c10/attachment.bin>


More information about the llvm-commits mailing list