[llvm-branch-commits] [flang] [MLIR][OpenMP] Add Lowering support for OpenMP Declare Mapper directive (PR #117046)

Akash Banerjee via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Dec 10 10:05:55 PST 2024


TIFitis wrote:

@kiranchandramohan I discussed the current approach with @skatrak today. When trying to implement the mapper lowering for the map clause, it became apparent that we need to add the `declMapperOp` name to the `SymbolTable`. As such, we would also need to hoist the `declareMapperOp` to the `ModuleOp`.

I am however struggling with name mangling the `declMapperOp` such that scoping information is preserved, and we don't have clashing `declMapperOps` from different nested scopes with the same name.

Take the following example:
```
program my_prog
   type my_type
      integer               :: num
   end type
   !$omp declare mapper (my_mapper : my_type :: my_var) map (my_var)
contains
   subroutine test
      type(my_type)            :: xyz
      !$omp target enter data map(mapper(my_mapper), to: xyz)
   end subroutine test
end program my_prog
```

Here after mangling the, `declMapperOp` symbol name becomes `_QQFmy_mapper`. But when trying to mangle the name that occurs in the mapClause before lookup results in `_QQFFtestmy_mapper`.

Do you know any mechanism in Fortran lowering that could help resolve this issue?

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


More information about the llvm-branch-commits mailing list