[PATCH] D150717: [RISCV] Use scalar stores for splats of zero to memory up to XLen

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 16 18:28:07 PDT 2023


reames updated this revision to Diff 522873.
reames retitled this revision from "[RISCV] Use scalar stores for splats of zero to memory upto 2 x XLen" to "[RISCV] Use scalar stores for splats of zero to memory up to XLen".
reames edited the summary of this revision.
reames added a comment.

Noticed while looking at something else that DAG combine store merging will produce the <2 x i64> vector stores this is splitting.  The particular test case came from memset lowering.  Oddly, this seeming conflict appears to work out, but it feels like we should really fix the store merging preference before handling the two stores part of this.

(following is removed from review description as it no longer applies, saved only for my later reference)

One concern here is that splitting the store into two instructions could introduce a store-to-load forwarding stall.  I think this is worth doing, but what do others think?  Should we restrict this to a maximum of XLEN sized operations which can be done in a single store?

This transform is potentially increasing the number of memory operations (from 1 to 2).  The same restriction mentioned above would resolve this as well.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D150717/new/

https://reviews.llvm.org/D150717

Files:
  llvm/lib/Target/RISCV/RISCVISelLowering.cpp
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-int-splat.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-mask-splat.ll

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


More information about the llvm-commits mailing list