[clang] [Clang] Lower fp atomic compound stmts into atomicrmw (PR #216033)
Paul Walker via cfe-commits
cfe-commits at lists.llvm.org
Fri Aug 21 06:35:13 PDT 2026
================
@@ -4105,14 +4102,21 @@ LValue ScalarExprEmitter::EmitCompoundAssignLValue(
// the loaded integer to double, performing FP arithmetics, and truncation
// back as a single atomic operation. Integer promotion is still
// semantically safe.
- bool CanEmitAtomicRMW =
+ bool CanEmitIntegerRMW =
!AtomicValueTy->isBooleanType() && AtomicValueTy->isIntegerType() &&
ResultTy->isIntegerType() &&
!(AtomicValueTy->isUnsignedIntegerType() &&
CGF.SanOpts.has(SanitizerKind::UnsignedIntegerOverflow)) &&
CGF.getLangOpts().getSignedOverflowBehavior() !=
LangOptions::SOB_Trapping;
- if (CanEmitAtomicRMW) {
+ bool CanEmitFloatingRMW = false;
+ if (!Builder.getIsFPConstrained() && AtomicValueTy->isFloatingType() &&
----------------
paulwalker-arm wrote:
In which case you'll want `CGF.getLangOpts().isFPConstrained()`?
https://github.com/llvm/llvm-project/pull/216033
More information about the cfe-commits
mailing list