[flang-commits] [mlir] [flang] [llvm] [flang][mlir][OpenMP] Add support for COPYPRIVATE (PR #73128)

Kiran Chandramohan via flang-commits flang-commits at lists.llvm.org
Thu Jan 18 03:40:32 PST 2024


kiranchandramohan wrote:

> The problem is that vla/assumed-shape arrays become `!fir.box<!fir.array<?xTYPE>>` and `!fir.box` is not accepted by the `omp` dialect (at least not by `OpenMP_PointerLikeType`). Modifying `OpenMP.cpp` to also pass boxes to `copyprivate` results in the following error: `'omp.single' op operand #0 must be variadic of OpenMP-compatible variable type, but got '!fir.box<!fir.array<?xi32>>'`
> 
> Is there a way to get the address of a box, to make it become a `!fir.ref<!fir.box<!fir.array<?xTYPE>>>`? `fir.box_addr` returns only the boxed value, without the other parameters needed to perform the copy.

Is it possible to create an alloca for the descriptor and store the descriptor there? This is what is done in https://github.com/llvm/llvm-project/pull/71766/files#diff-7af5cba654c125286dfc8703dfb2764d04c1c756171e74ba59e0a1666885b1b3

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


More information about the flang-commits mailing list