[llvm] [Offload]: Skip copying of unused kernel-mapped data (PR #124723)

via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 18 13:10:49 PST 2025


pradt2 wrote:

@jplehr @shiltian 

The details vary slightly depending on the mapping, but the bottom line is that unused mappings can be detected just by looking at the `ArgType` flags of the kernel arguments..

.For example, "freestanding buffers", i.e. `#pragma omp target map(buf[0:N]))`, that are unused in the kernel are missing the `OMP_TGT_MAPTYPE_TARGET_PARAM` flag, whereas unused "wrapped buffers", i.e. `#pragma omp target map(wrapper.buf[0:N])` can be detected by determining if the parent object (here - `wrapper`) is missing the `OMP_TGT_MAPTYPE_TARGET_PARAM` flag.

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


More information about the llvm-commits mailing list