[llvm-branch-commits] [clang] 8426097 - [OpenCL] Fix atomic_fetch_add/sub with half type
Tom Stellard via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Mon Feb 14 14:15:45 PST 2022
Author: Sven van Haastregt
Date: 2022-02-14T14:12:35-08:00
New Revision: 84260978cbf52485d9347e20386fda6bb82df763
URL: https://github.com/llvm/llvm-project/commit/84260978cbf52485d9347e20386fda6bb82df763
DIFF: https://github.com/llvm/llvm-project/commit/84260978cbf52485d9347e20386fda6bb82df763.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.
(cherry picked from commit fe690587bedb23dec2753549d4216059a7f894a1)
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 llvm-branch-commits
mailing list