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

Stanislav Mekhanoshin via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 14 15:00:44 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;
----------------
rampitec wrote:

Can it be unsafe? I.e. with denorm handling?

Also 4 cases below now all integer but checking isFloatTy().

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


More information about the llvm-commits mailing list