[PATCH] D126085: [RISCV] Add a subtarget feature to enable unaligned loads

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 20 12:32:15 PDT 2022


reames created this revision.
reames added reviewers: craig.topper, asb, frasercrmck, kito-cheng.
Herald added subscribers: sunshaoce, VincentWu, luke957, StephenFan, vkmr, 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.

A RISCV implementation can choose to implement unaligned load/store support.  We currently don't have a way for such a processor to indicate a preference for unaligned load/stores, so add a subtarget feature.

There doesn't appear to be a formal extension for unaligned support.  The RISCV Profiles (https://github.com/riscv/riscv-profiles/blob/main/profiles.adoc#rva20u64-profile) docs use the name Zicclsm, but a) that doesn't appear to actually been standardized, and b) isn't quite what we want here anyway due to the perf comment.

Instead, we can follow precedent from other backends and have a feature flag for the existence of misaligned load/stores with sufficient performance that user code should actually use them.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D126085

Files:
  llvm/lib/Target/RISCV/RISCV.td
  llvm/lib/Target/RISCV/RISCVISelLowering.cpp
  llvm/lib/Target/RISCV/RISCVSubtarget.h
  llvm/test/CodeGen/RISCV/unaligned-load-store.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D126085.431026.patch
Type: text/x-patch
Size: 8722 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220520/a6541d87/attachment-0001.bin>


More information about the llvm-commits mailing list