[clang] [clang][AMDGPU] Clean-up handling of named barrier type (PR #207687)

Sameer Sahasrabuddhe via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 23 23:54:29 PDT 2026


================
@@ -30,3 +30,38 @@ Please note that the specific architecture and feature names will vary depending
 
 Clang exposes AMDGPU hardware intrinsics as target-specific builtins with the
 `__builtin_amdgcn_` prefix. These are documented in {doc}`AMDGPUBuiltinReference`.
+
+## Target-Specific Types
+
+### Named Workgroup Barrier Type
+
+The `__amdgpu_named_workgroup_barrier_t` type is used to represent the GFX12.5 named barriers.
+Example usage:
+
+```c
+__amdgpu_named_workgroup_barrier_t x;
+__amdgpu_named_workgroup_barrier_t arr[2]; // Arrays are also fine
+
+void foo(int a)
+{
+  __builtin_amdgcn_s_barrier_init(&x, a);
+}
+```
+
+A "named barrier wrapper" is a class that contains exactly one field, which is either
----------------
ssahasra wrote:

Should the field be non-static?

https://github.com/llvm/llvm-project/pull/207687


More information about the cfe-commits mailing list