[llvm] [NVPTX] Properly support acquire/release/acq_rel atomics pre-SM70 by emitting membars (PR #222449)
Yonah Goldberg via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 30 18:01:31 PDT 2026
================
@@ -7917,9 +7924,10 @@ Instruction *NVPTXTargetLowering::emitTrailingFence(IRBuilderBase &Builder,
assert(SSID.has_value() && "Expected an atomic operation");
bool IsEmulated =
- CI ? cast<IntegerType>(CI->getCompareOperand()->getType())
- ->getBitWidth() < STI.getMinCmpXchgSizeInBits()
- : shouldExpandAtomicRMWInIR(RI) == AtomicExpansionKind::CmpXChg;
+ !STI.hasMemoryOrdering() ||
+ (CI ? cast<IntegerType>(CI->getCompareOperand()->getType())
+ ->getBitWidth() < STI.getMinCmpXchgSizeInBits()
+ : shouldExpandAtomicRMWInIR(RI) == AtomicExpansionKind::CmpXChg);
if (isAcquireOrStronger(Ord) && IsEmulated)
----------------
YonahGoldberg wrote:
Talked offline about doing this in a follow-up, resolving.
https://github.com/llvm/llvm-project/pull/222449
More information about the llvm-commits
mailing list