Files
llvm/offload/test/mapping
Abhinav GabaandClaude Opus 4.8 04a123b17c [OpenMP][Clang] Enable ATTACH-style maps for mappers. (#210213)
This is a follow-up to #153683 to support OpenMP compliant
pointer-attachment
in `declare_mappers` via `ATTACH`-style maps.

In addition to enabling attach-style maps, we also need to propagate
information about
which map entries are for "pointee" data, i.e. have an "attach-ptr", and
thus occupy a different storage block than the base variable for which
the mapper is being generated. e.g.

```c

S sa[10];
#pragma omp declare_mapper (default: S s) map (s.x, s.p[0:10])

#pragma omp target_enter_data map(sa)
```

The entry emitted for `s.p[0:10]` is for the pointee, i.e. it does not
share storage with `s`.
Mapper codegen needs to know that the entry for `sa[1].p[0:10]`, for
example, is not a `MEMBER_OF` the map of `sa`, as it occupies its own
storage and has its own ref-count tracking etc.


Flang currently passes an unconditional `PreserveMemberofFlags` bool to
the OMPIRBuilder function, which should eventually be propagated to
using the per-entry information so that `map(s%x)` should get MEMBER_OF
during mapper codgen, but `map(s%p(1:10))` should not. Currently, the
per-entry MapInfo field is set to `false` for flang, so the change is a
no-op for it. I don't have enough flang expertise/testing resources, so
I'll let Andrew update Flang in follow-up changes.

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-03 18:23:31 -07:00
..