@@ -1767,20 +1767,6 @@ buildDependData(std::optional<ArrayAttr> dependKinds, OperandRange dependVars,
17671767 }
17681768}
17691769
1770- static bool privatizerReadsSourceVariable (omp::PrivateClauseOp &priv) {
1771- if (priv.getDataSharingType () == omp::DataSharingClauseType::FirstPrivate)
1772- return true ;
1773-
1774- Region &initRegion = priv.getInitRegion ();
1775- if (initRegion.empty ())
1776- return false ;
1777-
1778- BlockArgument sourceVariable = priv.getInitMoldArg ();
1779- if (!sourceVariable)
1780- return false ;
1781- return !sourceVariable.use_empty ();
1782- }
1783-
17841770namespace {
17851771// / TaskContextStructManager takes care of creating and freeing a structure
17861772// / containing information needed by the task body to execute.
@@ -1833,7 +1819,7 @@ void TaskContextStructManager::generateTaskContextStruct() {
18331819 for (omp::PrivateClauseOp &privOp : privateDecls) {
18341820 // Skip private variables which can safely be allocated and initialised
18351821 // inside of the task
1836- if (!privatizerReadsSourceVariable ( privOp))
1822+ if (!privOp. readsFromMold ( ))
18371823 continue ;
18381824 Type mlirType = privOp.getType ();
18391825 privateVarTypes.push_back (moduleTranslation.convertType (mlirType));
@@ -1865,7 +1851,7 @@ void TaskContextStructManager::createGEPsToPrivateVars(
18651851 llvm::Value *zero = builder.getInt32 (0 );
18661852 unsigned i = 0 ;
18671853 for (auto privDecl : privateDecls) {
1868- if (!privatizerReadsSourceVariable ( privDecl)) {
1854+ if (!privDecl. readsFromMold ( )) {
18691855 // Handle this inside of the task so we don't pass unnessecary vars in
18701856 llvmPrivateVars.push_back (nullptr );
18711857 continue ;
@@ -2020,7 +2006,7 @@ convertOmpTaskOp(omp::TaskOp taskOp, llvm::IRBuilderBase &builder,
20202006 llvm::BasicBlock *privInitBlock = nullptr ;
20212007 for (auto [blockArg, privDecl, mlirPrivVar] :
20222008 llvm::zip_equal (privateBlockArgs, privateDecls, mlirPrivateVars)) {
2023- if (privatizerReadsSourceVariable ( privDecl))
2009+ if (privDecl. readsFromMold ( ))
20242010 // This is handled before the task executes
20252011 continue ;
20262012
0 commit comments