diff options
author | Jay Foad <jay.foad@amd.com> | 2024-07-03 11:35:51 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-03 11:35:51 +0100 |
commit | b76dd4edbfbba5593b691ef92b755f25cf63f445 (patch) | |
tree | 89220ea984832c1559f0be53f429cb2d4c6db538 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 2b3376f35340d86d766dc8007534f137bf93aed3 (diff) | |
download | llvm-b76dd4edbfbba5593b691ef92b755f25cf63f445.zip llvm-b76dd4edbfbba5593b691ef92b755f25cf63f445.tar.gz llvm-b76dd4edbfbba5593b691ef92b755f25cf63f445.tar.bz2 |
[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.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions