[llvm] [WIP][Offload] Introduce ATTACH map-type support for pointer attachment. (PR #149036)

Abhinav Gaba via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 17 08:59:45 PDT 2025


abhinavgaba 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 (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])`

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


More information about the llvm-commits mailing list