================ @@ -1730,6 +1730,126 @@ buildDependData(std::optional<ArrayAttr> dependKinds, OperandRange dependVars, } } +static bool privatizerReadsSourceVariable(omp::PrivateClauseOp &priv) { + if (priv.getDataSharingType() == omp::DataSharingClauseType::FirstPrivate) + return true; + + Region &initRegion = priv.getInitRegion(); + if (initRegion.empty()) + return false; + + BlockArgument sourceVariable = priv.getInitMoldArg(); + if (!sourceVariable) + return false; + return !sourceVariable.use_empty(); +} + +namespace { +/// TaskContextStructManager takes care of creating and freeing a structure +/// containing information needed by the task body to execute. +class TaskContextStructManager { +public: + TaskContextStructManager(llvm::IRBuilderBase &builder, + LLVM::ModuleTranslation &moduleTranslation, + MutableArrayRef<omp::PrivateClauseOp> privateDecls) + : builder{builder}, moduleTranslation{moduleTranslation}, + privateDecls{privateDecls} {} + + /// Creates a heap allocated struct containing space for each private + /// variable. Returns nullptr if there are is no struct needed. Invariant: + /// privateVarTypes, privateDecls, and the elements of the structure should + /// all have the same order (although privateDecls which do not read from the + /// mold argument are skipped). + void generateTaskContextStruct(); ---------------- ergawy wrote:
Nope, I don't mind. https://github.com/llvm/llvm-project/pull/125307 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits