[llvm] [CodeGen] Pass alignment and size to supportsUnalignedAtomics. NFC (PR #216621)
Antonio Frighetto via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 31 01:01:02 PDT 2026
================
@@ -2279,8 +2279,14 @@ class LLVM_ABI TargetLoweringBase {
/// require a more complex expansion.
unsigned getMinCmpXchgSizeInBits() const { return MinCmpXchgSizeInBits; }
- /// Whether the target supports unaligned atomic operations.
- bool supportsUnalignedAtomics() const { return SupportsUnalignedAtomics; }
+ /// Return true if the target supports an atomic access of \p SizeInBytes
+ /// bytes at the given \p Alignment. The default implementation only allows
+ /// naturally aligned atomics, unless setSupportsUnalignedAtomics(true) was
+ /// called.
+ virtual bool supportsAtomicAlignment(Align Alignment,
----------------
antoniofrighetto wrote:
I think either isAtomicAlignmentSupported (or maybe better, supportsAtomicAccess) would read more clearly, but up to you.
https://github.com/llvm/llvm-project/pull/216621
More information about the llvm-commits
mailing list