Files
clang-p2996/llvm/lib/Target/AMDGPU/AMDGPUAtomicOptimizer.cpp
Jay Foad b76dd4edbf [AMDGPU] Disable atomic optimization of fadd/fsub with result (#96479)
An atomic fadd instruction like this should return %x:

  ; value at %ptr is %x
  %r = atomicrmw fadd ptr %ptr, float %y

After atomic optimization, if %y is uniform, the result is calculated
as %r = %x + * %y * +0.0. This has a couple of problems:

1. If %y is Inf or NaN, this will return NaN instead of %x.
2. If %x is -0.0 and %y is positive, this will return +0.0 instead of
   -0.0.

Avoid these problems by disabling the "%y is uniform" path if there are
any uses of the result.
2024-07-03 11:35:51 +01:00

39 KiB