[flang-commits] [flang] [flang][OpenMP] incorrect handling for local variable in OpenMP parallel workshare firstprivate(P) (PR #195616)
Tom Eccles via flang-commits
flang-commits at lists.llvm.org
Tue May 26 09:00:00 PDT 2026
================
@@ -296,6 +301,74 @@ static mlir::func::FuncOp createCopyFunc(mlir::Location loc, mlir::Type varType,
return funcOp;
}
+/// Creates a copy function for box types that copies the array DATA
+/// (not just the descriptor) using the Fortran runtime's Assign function.
+/// This is needed for copyprivate of dynamically-sized arrays where each
+/// thread has its own allocation and needs the data copied from the
+/// single-executing thread.
+static mlir::func::FuncOp createBoxDataCopyFunc(mlir::Location loc,
----------------
tblah wrote:
Could this generate hlfir.assign instead of the runtime call? Doing so would mean this can use generic code for generating the call to the runtime function, and may allow inline implementations of the assignment for optimized builds.
https://github.com/llvm/llvm-project/pull/195616
More information about the flang-commits
mailing list