[PATCH] D156301: [AMDGPU] Support FAdd/FSub global atomics in AMDGPUAtomicOptimizer.

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 12 03:16:30 PDT 2023


foad added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUAtomicOptimizer.cpp:651-654
+  case AtomicRMWInst::FAdd:
+    return ConstantFP::get(C, APFloat::getZero(Ty->getFltSemantics(), true));
+  case AtomicRMWInst::FSub:
+    return ConstantFP::get(C, APFloat::getZero(Ty->getFltSemantics(), false));
----------------
arsenm wrote:
> foad wrote:
> > These are the wrong way round. You want +0 for fadd and -0 for fsub.
> No? This was wrong before and corrected. InstCombine uses -0 as fadd identity and +0 as fsub identity 
Oh yeah, you're right. Sorry for the noise.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D156301/new/

https://reviews.llvm.org/D156301



More information about the llvm-commits mailing list