[PATCH] D154739: [RISCV] Check for alignment when selecting whole register loads/stores

Luke Lau via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 7 12:39:02 PDT 2023


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

As per the specification, whole register vector loads and stores may raise a
misaligned address exception "if the base address is not naturally aligned to
the larger of the size of the encoded EEW in bytes (EEW/8) or the
implementation’s smallest supported SEW size in bytes (SEWMIN/8)."

This patch adds a predicate to ensure the alignment is greater than or equal to
the EEW in bytes. It doesn't check SEWMIN however since the smallest SEW can be
with the standard extensions is 8 bytes.

Note that this doesn't fix the issue raised here:
https://reviews.llvm.org/D154536#inline-1495073


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D154739

Files:
  llvm/lib/Target/RISCV/RISCVInstrInfoVSDPatterns.td
  llvm/test/CodeGen/RISCV/rvv/unaligned-loads-stores.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D154739.538231.patch
Type: text/x-patch
Size: 6142 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230707/bc9f4b49/attachment.bin>


More information about the llvm-commits mailing list