[PATCH] D131560: AMDGPU: Improve atomicrmw fadd selection

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 15 15:48:29 PDT 2022


arsenm added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp:1346
+    Atomic.legalFor({{S32, FlatPtr}});
+  if (AMDGPU::isGFX11Plus(ST))
+    Atomic.legalFor({{S32, FlatPtr}});
----------------
Using this predicate function instead of another ST method is inconsistent. Also can merge these two ifs into an or 


================
Comment at: llvm/test/CodeGen/AMDGPU/GlobalISel/llvm.amdgcn.global.atomic.fadd-with-ret.ll:7
 
-; GFX908: error: {{.*}} return versions of fp atomics not supported
+; GFX908: LLVM ERROR: cannot select: %4:vgpr_32(s32) = G_INTRINSIC_W_SIDE_EFFECTS intrinsic(@llvm.amdgcn.global.atomic.fadd), %0:vgpr(p1), %1:vgpr(s32) :: (volatile dereferenceable load store (s32) on %ir.ptr, addrspace 1) (in function: global_atomic_fadd_f32_rtn)
 
----------------
Degrading the error is somewhat unfortunate, but we don't consistently do this anyway


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

https://reviews.llvm.org/D131560



More information about the llvm-commits mailing list