[llvm] [OpenMP][Offload] Support `PRIVATE | ATTACH` maps for corresponding-pointer-initialization. (PR #160760)

Abhinav Gaba via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 25 12:07:58 PDT 2025


================
@@ -330,6 +330,54 @@ int targetDataMapper(ident_t *Loc, DeviceTy &Device, void *ArgBase, void *Arg,
   return Rc;
 }
 
+/// Returns a buffer of the requested \p Size, to be used as the source for
+/// `submitData`.
+///
+/// For small buffers (`Size <= sizeof(void*)`), uses \p AsyncInfo's
+/// getVoidPtrLocation().
+/// For larger buffers, creates a dynamic buffer which will be eventually
+/// deleted by \p AsyncInfo's post-processing callback.
+static char *getOrCreateSourceBufferForSubmitData(AsyncInfoTy &AsyncInfo,
----------------
abhinavgaba wrote:

The logic was extracted out of `performPointerAttachment`, so that it can be reused.

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


More information about the llvm-commits mailing list