[PATCH] D152845: [RISCV][InsertVSETVLI] Treat vmv.v.i as-if it were vmv.s.x when VL=1, and inactive lanes are undefined

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 13 11:24:46 PDT 2023


reames created this revision.
reames added reviewers: luke, asb, frasercrmck, craig.topper, kito-cheng.
Herald added subscribers: jobnoorman, VincentWu, vkmr, luismarques, apazos, sameer.abuasal, s.egerton, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, shiva0217, 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.

This is a subset of D151653 <https://reviews.llvm.org/D151653>, slightly cleaned up.

A vmv.v.i splats the immediate to all active lanes.  For the active lanes, this is the same as vmv.s.x which inserts one scalar into the low lane.  If we can ignore all the inactive lanes (because they are known undefined), then the two are semantically equivalent.  We already reason about compatible VL/VTYPE combinations for vmv.s.x, apply the same logic to vmv.v.i.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D152845

Files:
  llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-reduction-int-vp.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-reduction-int.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152845.531004.patch
Type: text/x-patch
Size: 6764 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230613/555576fe/attachment.bin>


More information about the llvm-commits mailing list