[llvm] [AMDGPU][AtomicExpand] Use full flat emulation if feasible (PR #142859)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 4 17:41:05 PDT 2025


================
@@ -17541,9 +17541,11 @@ void SITargetLowering::emitExpandAtomicAddrSpacePredicate(
   // where we only insert a check for private and still use the flat instruction
   // for global and shared.
 
-  bool FullFlatEmulation = RMW && RMW->getOperation() == AtomicRMWInst::FAdd &&
-                           Subtarget->hasAtomicFaddInsts() &&
-                           RMW->getType()->isFloatTy();
+  bool FullFlatEmulation =
+      RMW && RMW->getOperation() == AtomicRMWInst::FAdd &&
+      ((Subtarget->hasAtomicFaddInsts() && RMW->getType()->isFloatTy()) ||
+       (Subtarget->hasFlatBufferGlobalAtomicFaddF64Inst() &&
+        RMW->getType()->isDoubleTy()));
----------------
arsenm wrote:

Title is the same? 

https://github.com/llvm/llvm-project/pull/142859


More information about the llvm-commits mailing list