[clang] 2d9c891 - [OpenCL] Fix atomic_fetch_add/sub half overloads

Sven van Haastregt via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 17 01:53:57 PDT 2022


Author: Sven van Haastregt
Date: 2022-06-17T09:53:45+01:00
New Revision: 2d9c891cd949a4e6f15c35bd565b3d3588819e85

URL: https://github.com/llvm/llvm-project/commit/2d9c891cd949a4e6f15c35bd565b3d3588819e85
DIFF: https://github.com/llvm/llvm-project/commit/2d9c891cd949a4e6f15c35bd565b3d3588819e85.diff

LOG: [OpenCL] Fix atomic_fetch_add/sub half overloads

Some of the atomic_fetch_add and atomic_fetch_sub overloads intended
for atomic_half types accidentally had an atomic_float parameter.

Added: 
    

Modified: 
    clang/lib/Sema/OpenCLBuiltins.td

Removed: 
    


################################################################################
diff  --git a/clang/lib/Sema/OpenCLBuiltins.td b/clang/lib/Sema/OpenCLBuiltins.td
index 75cea2ffc19c..dc158454556a 100644
--- a/clang/lib/Sema/OpenCLBuiltins.td
+++ b/clang/lib/Sema/OpenCLBuiltins.td
@@ -1185,7 +1185,7 @@ let MinVersion = CL20 in {
       defvar extension_fp64 = !cast<FunctionExtension>("FuncExtFloatAtomicsFp64" # addrspace # "Add");
 
       defm : BuiltinAtomicExplicit<"atomic_fetch_" # ModOp,
-          [Half, PointerType<VolatileType<AtomicFloat>, addrspace>, Half], extension_fp16>;
+          [Half, PointerType<VolatileType<AtomicHalf>, addrspace>, Half], extension_fp16>;
       defm : BuiltinAtomicExplicit<"atomic_fetch_" # ModOp,
           [Float, PointerType<VolatileType<AtomicFloat>, addrspace>, Float], extension_fp32>;
       defm : BuiltinAtomicExplicit<"atomic_fetch_" # ModOp,


        


More information about the cfe-commits mailing list