[PATCH] D147470: [RISCV] Account for LMUL in memory op costs

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 3 13:43:26 PDT 2023


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

Generally, the cost of a memory op will scale with the number of vector registers accessed.  Machines might exist which have a narrow memory access than vector register width, but machines with a wider memory access width than vector register width seem unlikely.

I noticed this because we were preferring wide loads + deinterleaves on examples where the cost of a short gather (actually a strided load) would be better.  Touching 4 vector registers instead of doing a 4 element gather is not a good tradeoff.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D147470

Files:
  llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
  llvm/test/Analysis/CostModel/RISCV/masked_ldst.ll
  llvm/test/Analysis/CostModel/RISCV/rvv-load-store.ll
  llvm/test/Transforms/LoopVectorize/RISCV/interleaved-cost.ll
  llvm/test/Transforms/LoopVectorize/RISCV/riscv-vector-reverse.ll
  llvm/test/Transforms/LoopVectorize/RISCV/strided-accesses.ll
  llvm/test/Transforms/LoopVectorize/RISCV/zvl32b.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D147470.510590.patch
Type: text/x-patch
Size: 45119 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230403/f34b99c5/attachment-0001.bin>


More information about the llvm-commits mailing list