[clang] [Clang][AMDGPU] Add ``amdgcn_av("none")`` attribute for atomic expressions (PR #199622)

Fabian Ritter via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 18 01:01:17 PDT 2026


================
@@ -3577,6 +3577,29 @@ An error will be given if:
   }];
 }
 
+def AMDGCNAVDocs : Documentation {
+  let Category = DocCatAMDGPUAttributes;
+  let Content = [{
+This attribute controls MakeAvailable and MakeVisible cache operations on
+AMDGPU synchronization operations. It takes a string argument specifying the
+mode.
+
+When placed on a statement containing a C/C++ atomic builtin call, the
+resulting atomic or fence instruction will carry ``!mmra !{!"amdgcn-av",
+!"<mode>"}`` metadata.
+
+The supported modes are:
+
+- ``"none"``: Skip cache writeback (on release) and cache invalidation (on
+  acquire), while preserving memory ordering (waits).
----------------
ritter-x2a wrote:

That characterization is quite different from the [semantics-oriented documentation](https://llvm.org/docs/AMDGPUMemoryModel.html) we have for MakeAvailable and MakeVisible.
Should there be a link to that documentation in this doc entry, and should this at least **also** say that `"none"` skips MakeAvailable and MakeVisible operations on release/acquire?

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


More information about the cfe-commits mailing list