diff options
author | zhijian lin <zhijian@ca.ibm.com> | 2025-06-13 09:14:48 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-06-13 09:14:48 -0400 |
commit | 85a9f2e14859b472750f13fb441291e6e9c893a0 (patch) | |
tree | 22b3480c0605b444554dad3b1e66ca1adb94ee16 /llvm/lib/ProfileData/Coverage/CoverageMapping.cpp | |
parent | a59e4acd753007c83594a6a56654025d4202a528 (diff) | |
download | llvm-85a9f2e14859b472750f13fb441291e6e9c893a0.zip llvm-85a9f2e14859b472750f13fb441291e6e9c893a0.tar.gz llvm-85a9f2e14859b472750f13fb441291e6e9c893a0.tar.bz2 |
[PowerPC] enable AtomicExpandImpl::expandAtomicCmpXchg for powerpc (#142395)
In PowerPC, the AtomicCmpXchgInst is lowered to
ISD::ATOMIC_CMP_SWAP_WITH_SUCCESS. However, this node does not handle
the weak attribute of AtomicCmpXchgInst. As a result, when compiling C++
atomic_compare_exchange_weak_explicit, the generated assembly includes a
"reservation lost" loop — i.e., it branches back and retries if the
stwcx. (store-conditional) fails. This differs from GCC’s codegen, which
does not include that loop for weak compare-exchange.
Since PowerPC uses LL/SC-style atomic instructions, the patch enables
AtomicExpandImpl::expandAtomicCmpXchg for PowerPC. With this, the weak
attribute is properly respected, and the "reservation lost" loop is
removed for weak operations.
---------
Co-authored-by: Matt Arsenault <arsenm2@gmail.com>
Diffstat (limited to 'llvm/lib/ProfileData/Coverage/CoverageMapping.cpp')
0 files changed, 0 insertions, 0 deletions