[llvm] AMDGPU: Preliminary documentation for named barriers (PR #165502)
Nicolai Hähnle via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 4 08:03:39 PST 2025
================
@@ -1179,6 +1179,52 @@ is conservatively correct for OpenCL.
other operations within the same address space.
======================= ===================================================
+Target Types
+------------
+
+The AMDGPU backend implements some target extension types.
+
+.. _amdgpu-types-named-barriers:
+
+Named Barriers
+~~~~~~~~~~~~~~
+
+Named barriers are fixed function hardware barrier objects that are available
+in gfx12.5+ in addition to the traditional default barriers.
+
+In LLVM IR, named barriers are represented by global variables of type
+``target("amdgcn.named.barrier", 0)`` in the LDS address space. Named barrier
+global variables do not occupy actual LDS memory, but their lifetime and
+allocation scope matches that of global variables in LDS. Programs in LLVM IR
+refer to named barriers using pointers.
+
+The following named barrier types are supported in global variables, defined
+recursively:
+
+* a single, standalone ``target("amdgcn.named.barrier", 0)``
+* an array of supported types
+* a struct containing a single element of supported type
----------------
nhaehnle wrote:
Yes to the first question.
To the second question: We could do that, it just didn't seem important and would be additional effort. The reason for allowing a struct is to allow wrapping types in C++ structs/classes.
https://github.com/llvm/llvm-project/pull/165502
More information about the llvm-commits
mailing list