[clang] fe69058 - [OpenCL] Fix atomic_fetch_add/sub with half type
Sven van Haastregt via cfe-commits
cfe-commits at lists.llvm.org
Wed Feb 9 02:47:57 PST 2022
Author: Sven van Haastregt
Date: 2022-02-09T10:47:45Z
New Revision: fe690587bedb23dec2753549d4216059a7f894a1
URL: https://github.com/llvm/llvm-project/commit/fe690587bedb23dec2753549d4216059a7f894a1
DIFF: https://github.com/llvm/llvm-project/commit/fe690587bedb23dec2753549d4216059a7f894a1.diff
LOG: [OpenCL] Fix atomic_fetch_add/sub with half type
An error in the tablegen description affects the declarations
provided by `-fdeclare-opencl-builtins` for `atomic_fetch_add` and
`atomic_fetch_sub`.
The atomic argument should be an atomic_half, not an atomic_float.
Added:
Modified:
clang/lib/Sema/OpenCLBuiltins.td
Removed:
################################################################################
diff --git a/clang/lib/Sema/OpenCLBuiltins.td b/clang/lib/Sema/OpenCLBuiltins.td
index 08f8630a67e22..60a05f95fbec8 100644
--- a/clang/lib/Sema/OpenCLBuiltins.td
+++ b/clang/lib/Sema/OpenCLBuiltins.td
@@ -1138,7 +1138,7 @@ let MinVersion = CL20 in {
foreach ModOp = ["add", "sub"] in {
let Extension = FuncExtFloatAtomicsFp16GlobalAdd in {
defm : BuiltinAtomicExplicit<"atomic_fetch_" # ModOp,
- [Half, PointerType<VolatileType<AtomicFloat>, GlobalAS>, Half]>;
+ [Half, PointerType<VolatileType<AtomicHalf>, GlobalAS>, Half]>;
}
let Extension = FuncExtFloatAtomicsFp32GlobalAdd in {
defm : BuiltinAtomicExplicit<"atomic_fetch_" # ModOp,
@@ -1150,7 +1150,7 @@ let MinVersion = CL20 in {
}
let Extension = FuncExtFloatAtomicsFp16LocalAdd in {
defm : BuiltinAtomicExplicit<"atomic_fetch_" # ModOp,
- [Half, PointerType<VolatileType<AtomicFloat>, LocalAS>, Half]>;
+ [Half, PointerType<VolatileType<AtomicHalf>, LocalAS>, Half]>;
}
let Extension = FuncExtFloatAtomicsFp32LocalAdd in {
defm : BuiltinAtomicExplicit<"atomic_fetch_" # ModOp,
@@ -1162,7 +1162,7 @@ let MinVersion = CL20 in {
}
let Extension = FuncExtFloatAtomicsFp16GenericAdd in {
defm : BuiltinAtomicExplicit<"atomic_fetch_" # ModOp,
- [Half, PointerType<VolatileType<AtomicFloat>, GenericAS>, Half]>;
+ [Half, PointerType<VolatileType<AtomicHalf>, GenericAS>, Half]>;
}
let Extension = FuncExtFloatAtomicsFp32GenericAdd in {
defm : BuiltinAtomicExplicit<"atomic_fetch_" # ModOp,
More information about the cfe-commits
mailing list