[flang-commits] [flang] [Flang][Lower][OpenMP] Add initial lowering of pointers/allocatables/target in map clauses to map_info and entries (PR #68600)

Razvan Lupusoru via flang-commits flang-commits at lists.llvm.org
Mon Oct 9 11:57:13 PDT 2023


https://github.com/razvanlupusoru requested changes to this pull request.

Other than the comments I have on the various piece of code, I also am not sure about adding this code directly to lowering. Descriptors are an implementation detail. From a user's perspective, the clauses they use specifically refer to the data.

Thus the mapping is also an implementation detail - and one that the compiler can exploit. The descriptor can be mapped with a "to" clause or even firstprivatized. So I think the better place to put this code is a pass after lowering. Straightforward to do:
1) Walk through each construct that consumes the map info operations.
2) Collect the set of box references and box's data references in data clauses.
3) Initial candidate set is all of the boxes whose base_addr is used in map info
4) Subtract the set of boxes already in data clauses
5) Generate the appropriate map info entry for the box and insert it right before the mapping operation for its data.


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


More information about the flang-commits mailing list