[clang] [clang][SYCL] Add __builtin_sycl_dynamic_local_memory (PR #244373)
Tom Honermann via cfe-commits
cfe-commits at lists.llvm.org
Sun Nov 22 21:05:32 PST 2026
================
@@ -4414,6 +4414,23 @@ builtin, the mangler emits their usual pattern without any special treatment.
constexpr const char * __builtin_sycl_unique_stable_name( type-id );
```
+### `__builtin_sycl_dynamic_local_memory`
+
+`__builtin_sycl_dynamic_local_memory()` returns a pointer to the start of the
+dynamic local memory block of the current work-group. It is intended for use by
+the SYCL runtime library, e.g. to implement local accessors, and not by user
+code.
+
----------------
tahonermann wrote:
I think use of the builtin will need to be restricted to the same translation unit in which the kernel is defined. See [this comment](https://github.com/llvm/llvm-project/pull/231160/changes#r4661320962) on the PR to enable `DynSharedMemory` for Level Zero. If that is correct, we should document the limitation.
https://github.com/llvm/llvm-project/pull/244373
More information about the cfe-commits
mailing list