[PATCH] D152368: [RISCV] Use vslidedown.vi vN, vN, 0 instead of vslideup.vi vN, vM, 0

Luke Lau via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 7 05:56:05 PDT 2023


luke created this revision.
luke added reviewers: craig.topper, reames, 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, alextsao1999, pcwang-thead, eopXD, MaskRay.
Herald added a project: LLVM.

These instructions are semantically identical in the case where the
offset is 0 with the exception that vslideup has a vector overlap
constraint and vslidedown doesn't. As a result, we can prefer the one
without register overlap constraints to improve register allocation
flexibility.

This patch implements https://reviews.llvm.org/D152298 but as a DAG
combine. It catches a few more cases, including some scalable vectors.

Co-authored-by: preames at rivosinc.com


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D152368

Files:
  llvm/lib/Target/RISCV/RISCVISelLowering.cpp
  llvm/test/CodeGen/RISCV/rvv/extract-subvector.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-calling-conv.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-extload-truncstore.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-extract-subvector.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-fp-buildvec.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-fp-setcc.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-insert-subvector.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-int-shuffles.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-interleaved-access.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-mask-splat.ll
  llvm/test/CodeGen/RISCV/rvv/insert-subvector.ll
  llvm/test/CodeGen/RISCV/rvv/shuffle-reverse.ll
  llvm/test/CodeGen/RISCV/rvv/vector-interleave-fixed.ll
  llvm/test/CodeGen/RISCV/rvv/vreductions-fp-sdnode.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152368.529274.patch
Type: text/x-patch
Size: 39861 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230607/e1cf9c2e/attachment.bin>


More information about the llvm-commits mailing list