[llvm-branch-commits] [clang] [lld] [llvm] [mlir] [RFC][AMDGPU] Add BARRIER address space (PR #195613)

Nicolai Hähnle via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Jun 8 07:37:36 PDT 2026


================
@@ -84,6 +91,11 @@ enum : unsigned {
   // Some places use this if the address space can't be determined.
   UNKNOWN_ADDRESS_SPACE = ~0u,
 };
+
+/// The BARRIER AS is does not have an aperture in HW, so when converting
+/// BARRIER addresses from/to generic, we represent them as LDS addresses
+/// offset by a large amount so they can never alias with real LDS memory.
----------------
nhaehnle wrote:

I agree we need to be able to roundtrip this address space through `addrspace(0)`, but I don't follow this point.

Taking a barrier pointer, casting it to flat/generic and then trying to load/store it is inherently undefined behavior as mentioned in AMDGPUUsage.rst (though perhaps it could be a bit more explicit).

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


More information about the llvm-branch-commits mailing list