[PATCH] D149375: [RISCV] Introduce unaligned-vector-mem feature

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 27 12:22:55 PDT 2023


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

This allows us to model and thus test transforms which are legal only when a vector load with less than element alignment are supported.  This was originally part of D126085 <https://reviews.llvm.org/D126085>, but was split out as we didn't have a good example of such a transform.  As can be seen in the test diffs, we have the recently added concat_vector(loads) -> strided_load transform (from D147713 <https://reviews.llvm.org/D147713>) which now benefits from the unaligned support.

While making this change, I realized that we actually *do* support unaligned vector loads and stores of all types via conversion to i8 element type.  For contiguous loads and stores, we actually already implement this in the backend - though we don't tell the optimizer that.  For indexed, lowering to i8 requires complicated addressing.  For indexed and segmented, we'd have to use indexed.  All around, doesn't seem worthwhile pursuing, but makes for an interesting observation.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D149375

Files:
  llvm/lib/Target/RISCV/RISCVFeatures.td
  llvm/lib/Target/RISCV/RISCVISelLowering.cpp
  llvm/lib/Target/RISCV/RISCVTargetTransformInfo.h
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-strided-load-combine.ll
  llvm/test/CodeGen/RISCV/rvv/unaligned-loads-stores.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D149375.517675.patch
Type: text/x-patch
Size: 16469 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230427/2f3a7914/attachment.bin>


More information about the llvm-commits mailing list