doru1004 added inline comments.
================ Comment at: clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp:448 return; - if (E->getCastKind() == CK_ArrayToPointerDecay) { - const bool SavedAllEscaped = AllEscaped; ---------------- ABataev wrote: > I think you need to check that the array is allocated in the parallel > context, otherwise there might be a crash, if it is allocated in the target > context and many threads would like to access it. I believe that this is how this condition got here: the inability to check that particular aspect (since we are in a function and the target/parallel is not visible) so basically just emit it as kmpc_alloc_shared conservatively. The more I think about it the more I believe we should leave this as is and not change it. The solution might be to improve the optimization of these cases rather than the emission itself. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148805/new/ https://reviews.llvm.org/D148805 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits