[PATCH] D151103: [RISCV] Scalarize small fixed vector copies < XLEN

Luke Lau via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 22 07:42:36 PDT 2023


luke created this revision.
luke added reviewers: reames, craig.topper, asb, kito-cheng.
Herald added subscribers: jobnoorman, 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, 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.

For small fixed-length vector copies like
vsetivli   zero, 2, e16, m1, ta, ma
vle16.v    v8, (a0)
vse16.v    v8, (a1)

We can scalarize them if the total vector size < XLEN:
lw a0, 0(a0)
sw a0, 0(a1)

This patch adds a DAG combine to do so, reusing much of the existing
logic in https://reviews.llvm.org/D150717


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D151103

Files:
  llvm/lib/Target/RISCV/RISCVISelLowering.cpp
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-load-store.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-mask-load-store.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D151103.524307.patch
Type: text/x-patch
Size: 13600 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230522/1b041a63/attachment.bin>


More information about the llvm-commits mailing list