[PATCH] D158163: [RISCV] Narrow types of index operand matched pattern (shl_vl (zext_vl), C)

Liao Chunyu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 17 03:08:23 PDT 2023


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

Similar to D154687 <https://reviews.llvm.org/D154687>, we can optimize fix length vector.

lowerBUILD_VECTOR lower BUILD_VECTOR to RISCVISD::VMV_V_X_VL.
Add isVMV_V_X_VLOfConstant, which implements similar functionality of isBuildVectorOfConstantSDNodes.

extract_subvector + insert_subvector can be optimize in 
visitINSERT_SUBVECTOR <https://github.com/llvm/llvm-project/blob/main/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp#L25601>.
Optimization is advanced for better type narrowing.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D158163

Files:
  llvm/lib/Target/RISCV/RISCVISelLowering.cpp
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-masked-gather.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-masked-scatter.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vpgather.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vpscatter.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D158163.551065.patch
Type: text/x-patch
Size: 44668 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230817/1d297378/attachment.bin>


More information about the llvm-commits mailing list