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

Pravin Jagtap via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 11 05:47:01 PDT 2023


pravinjagtap added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUAtomicOptimizer.cpp:760
   }
-  Mbcnt = B.CreateIntCast(Mbcnt, Ty, false);
+  Mbcnt = !isAtomicFloatingPointTy ? B.CreateIntCast(Mbcnt, Ty, false) : Mbcnt;
 
----------------
foad wrote:
> Might be clearer as:
> `Mbcnt = isAtomicFloatingPointTy ? B.CreateUIToFP(Mbcnt, Ty) : B.CreateIntCast(Mbcnt, Ty, false);`
> (instead of doing the fp cast on line 996) since in both cases we want to convert Mbcnt to type Ty.
If we convert `Mbcnt` to `float` here, Integer comparison will fail at line no 869 


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