[llvm] AMDGPU: Support local atomicrmw fmin/fmax for float/double (PR #95590)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 15 01:10:24 PDT 2024


================
@@ -16042,7 +16027,15 @@ SITargetLowering::shouldExpandAtomicRMWInIR(AtomicRMWInst *RMW) const {
     return AtomicExpansionKind::CmpXChg;
   }
   case AtomicRMWInst::FMin:
-  case AtomicRMWInst::FMax:
+  case AtomicRMWInst::FMax: {
+    Type *Ty = RMW->getType();
+
+    // LDS float and double fmin/fmax were always supported.
+    if (AS == AMDGPUAS::LOCAL_ADDRESS && (Ty->isFloatTy() || Ty->isDoubleTy()))
+      return AtomicExpansionKind::None;
----------------
arsenm wrote:

No, LDS atomics are always well behaved. I think denormals always worked correctly even for the global cases too for fmin/fmax 

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


More information about the llvm-commits mailing list