[PATCH] D142264: [RISCV] Combine extract_vector_elt followed by VFMV_S_F_VL.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 20 16:15:06 PST 2023


craig.topper created this revision.
craig.topper added reviewers: reames, frasercrmck, rogfer01, kito-cheng.
Herald added subscribers: luke, VincentWu, vkmr, evandro, luismarques, apazos, sameer.abuasal, s.egerton, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, edward-jones, zzheng, jrtc27, shiva0217, niosHD, sabuasal, simoncook, johnrusso, rbar, asb, hiraditya, arichardson.
Herald added a project: All.
craig.topper requested review of this revision.
Herald added subscribers: pcwang-thead, eopXD, MaskRay.
Herald added a project: LLVM.

If we're extracting an element and inserting into a undef vector
with the same number of elements, we can use the original vector.

This pattern occurs around reductions that have been cascaded
together.

This can be generalized to wider/narrow vectors by using
insert_subvector/extract_subvector, but we don't have lit tests
for that case currently.

We can also support non-undef before by using a slide or vmv.v.v


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D142264

Files:
  llvm/lib/Target/RISCV/RISCVISelLowering.cpp
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-reduction-fp-vp.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-reduction-fp.ll
  llvm/test/CodeGen/RISCV/rvv/vreductions-fp-vp.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D142264.491002.patch
Type: text/x-patch
Size: 11344 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230121/1bfc04e4/attachment-0001.bin>


More information about the llvm-commits mailing list