[PATCH] D150798: [RISCV] Implement storeOfVectorConstantIsCheap hook to prevent store merging at VL=2

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 17 10:10:38 PDT 2023


reames created this revision.
reames added reviewers: craig.topper, asb, l.frisken, kito-cheng.
Herald added subscribers: jobnoorman, luke, VincentWu, vkmr, frasercrmck, luismarques, apazos, sameer.abuasal, pengfei, 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.

In general, VL=2 vectors are very questionable profitability wise.  For constants specifically, our inability to materialize many vector constants cheaply biases us strongly towards unprofitability at VL=2.

This hook is very close to the x86 implementation.  The difference is that X86 whitelists stores of zeros, and we're better off letting that stay scalar at VL=2.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D150798

Files:
  llvm/lib/Target/RISCV/RISCVISelLowering.h
  llvm/test/CodeGen/RISCV/rvv/combine-store.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D150798.523093.patch
Type: text/x-patch
Size: 4469 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230517/b545b968/attachment.bin>


More information about the llvm-commits mailing list