[llvm] [WIP][Offload] Introduce ATTACH map-type support for pointer attachment. (PR #149036)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 17 09:52:41 PDT 2025
agozillon wrote:
> This change will only affect cases where the compiler emits ATTACH maps. So, the existing PTR_AND_OBJ maps still work as-is.
>
> The only potential impact is that we will be keeping track of any new allocations and their sizes in a hashmap. But that information will not be used if no ATTACH map is encountered.
>
> The initial PR for emitting ATTACH maps for clang ([abhinavgaba#1](https://github.com/abhinavgaba/llvm-project/pull/1)), which this change was verified with, only uses the ATTACH maps for when the base-pointer that is eligible for attachment is a scalar variable that's not a member of a struct (like the example in the description). For other cases, like: `int **p; ... map(p[0][1])`, clang still uses `PTR_AND_OBJ` maps for now.
>
> And the map from case `B` is fairly common. Even for case `A`, it's used as the first map. And it's used for mapping array-elements/array-sections based on arrays, like `int a[10]; ... map(a[1:2])`
Thank you very much for clarifying! Excited for the addition, just not so much any potential work moving flang over to it ;-) but has to be done and I imagine it'll give us more flexibility.
https://github.com/llvm/llvm-project/pull/149036
More information about the llvm-commits
mailing list