@@ -1755,20 +1755,6 @@ buildDependData(std::optional<ArrayAttr> dependKinds, OperandRange dependVars,
17551755 }
17561756}
17571757
1758- static bool privatizerReadsSourceVariable (omp::PrivateClauseOp &priv) {
1759- if (priv.getDataSharingType () == omp::DataSharingClauseType::FirstPrivate)
1760- return true ;
1761-
1762- Region &initRegion = priv.getInitRegion ();
1763- if (initRegion.empty ())
1764- return false ;
1765-
1766- BlockArgument sourceVariable = priv.getInitMoldArg ();
1767- if (!sourceVariable)
1768- return false ;
1769- return !sourceVariable.use_empty ();
1770- }
1771-
17721758namespace {
17731759// / TaskContextStructManager takes care of creating and freeing a structure
17741760// / containing information needed by the task body to execute.
@@ -1821,7 +1807,7 @@ void TaskContextStructManager::generateTaskContextStruct() {
18211807 for (omp::PrivateClauseOp &privOp : privateDecls) {
18221808 // Skip private variables which can safely be allocated and initialised
18231809 // inside of the task
1824- if (!privatizerReadsSourceVariable ( privOp))
1810+ if (!privOp. readsFromMold ( ))
18251811 continue ;
18261812 Type mlirType = privOp.getType ();
18271813 privateVarTypes.push_back (moduleTranslation.convertType (mlirType));
@@ -1853,7 +1839,7 @@ void TaskContextStructManager::createGEPsToPrivateVars(
18531839 llvm::Value *zero = builder.getInt32 (0 );
18541840 unsigned i = 0 ;
18551841 for (auto privDecl : privateDecls) {
1856- if (!privatizerReadsSourceVariable ( privDecl)) {
1842+ if (!privDecl. readsFromMold ( )) {
18571843 // Handle this inside of the task so we don't pass unnessecary vars in
18581844 llvmPrivateVars.push_back (nullptr );
18591845 continue ;
@@ -2008,7 +1994,7 @@ convertOmpTaskOp(omp::TaskOp taskOp, llvm::IRBuilderBase &builder,
20081994 llvm::BasicBlock *privInitBlock = nullptr ;
20091995 for (auto [blockArg, privDecl, mlirPrivVar] :
20101996 llvm::zip_equal (privateBlockArgs, privateDecls, mlirPrivateVars)) {
2011- if (privatizerReadsSourceVariable ( privDecl))
1997+ if (privDecl. readsFromMold ( ))
20121998 // This is handled before the task executes
20131999 continue ;
20142000
0 commit comments