[PATCH] D137856: [RISCV] Reduce VL of splat instructions used to feed stores

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 11 11:30:29 PST 2022


reames created this revision.
reames added reviewers: craig.topper, frasercrmck, asb.
Herald added subscribers: sunshaoce, VincentWu, StephenFan, vkmr, 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, bollu, simoncook, johnrusso, rbar, hiraditya, arichardson, mcrosier.
Herald added a project: All.
reames requested review of this revision.
Herald added subscribers: pcwang-thead, eopXD, MaskRay.
Herald added a project: LLVM.

If we splat a value into N lanes, and then the only use of the resulting vector is a store of M lanes, we can reduce the size of the splat to min(M,N).  Lanes between M and N (if M < N) can't be observed.

In principle, reducing the width of the splat could cause an additional VL toggle, but this appears not to happen much in practice.

This is a carved down version D130895 <https://reviews.llvm.org/D130895>.  The intention of this patch is to provide a base from which complexity of that patch can be added upon with incremental review.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D137856

Files:
  llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
  llvm/lib/Target/RISCV/RISCVISelDAGToDAG.h
  llvm/test/CodeGen/RISCV/rvv/vsetvli-insert-crossbb.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D137856.474816.patch
Type: text/x-patch
Size: 7695 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221111/41f6eadd/attachment.bin>


More information about the llvm-commits mailing list