[PATCH] D104032: [RISCV] Transform unaligned RVV vector loads/stores to aligned ones

Fraser Cormack via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 10 07:31:18 PDT 2021


frasercrmck created this revision.
frasercrmck added reviewers: craig.topper, HsiangKai, rogfer01, khchen, arcbbb, evandro.
Herald added subscribers: vkmr, luismarques, apazos, sameer.abuasal, s.egerton, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, edward-jones, zzheng, jrtc27, shiva0217, kito-cheng, niosHD, sabuasal, simoncook, johnrusso, rbar, asb, hiraditya.
frasercrmck requested review of this revision.
Herald added subscribers: llvm-commits, MaskRay.
Herald added a project: LLVM.

This patch adds support for loading and storing unaligned vectors via an
equivalently-sized i8 vector type, which has support in the RVV
specification for byte-aligned access.

This offers a more optimal path for handling of unaligned fixed-length
vector accesses, which are currently scalarized. It also prevents
crashing when `LegalizeDAG` sees an unaligned scalable-vector load/store
operation.

Future work could be to investigate loading/storing via the largest
vector element type for the given alignment, in case that would be more
optimal on hardware. For instance, a 4-byte-aligned nxv2i64 vector load
could loaded as nxv4i32 instead of as nxv16i8.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D104032

Files:
  llvm/lib/Target/RISCV/RISCVISelLowering.cpp
  llvm/lib/Target/RISCV/RISCVISelLowering.h
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-unaligned.ll
  llvm/test/CodeGen/RISCV/rvv/unaligned-loads-stores.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104032.351169.patch
Type: text/x-patch
Size: 25270 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210610/113162ff/attachment.bin>


More information about the llvm-commits mailing list