@@ -1730,20 +1730,6 @@ buildDependData(std::optional<ArrayAttr> dependKinds, OperandRange dependVars,
17301730 }
17311731}
17321732
1733- static bool privatizerReadsSourceVariable (omp::PrivateClauseOp &priv) {
1734- if (priv.getDataSharingType () == omp::DataSharingClauseType::FirstPrivate)
1735- return true ;
1736-
1737- Region &initRegion = priv.getInitRegion ();
1738- if (initRegion.empty ())
1739- return false ;
1740-
1741- BlockArgument sourceVariable = priv.getInitMoldArg ();
1742- if (!sourceVariable)
1743- return false ;
1744- return !sourceVariable.use_empty ();
1745- }
1746-
17471733namespace {
17481734// / TaskContextStructManager takes care of creating and freeing a structure
17491735// / containing information needed by the task body to execute.
@@ -1796,7 +1782,7 @@ void TaskContextStructManager::generateTaskContextStruct() {
17961782 for (omp::PrivateClauseOp &privOp : privateDecls) {
17971783 // Skip private variables which can safely be allocated and initialised
17981784 // inside of the task
1799- if (!privatizerReadsSourceVariable ( privOp))
1785+ if (!privOp. readsFromMold ( ))
18001786 continue ;
18011787 Type mlirType = privOp.getType ();
18021788 privateVarTypes.push_back (moduleTranslation.convertType (mlirType));
@@ -1828,7 +1814,7 @@ void TaskContextStructManager::createGEPsToPrivateVars(
18281814 llvm::Value *zero = builder.getInt32 (0 );
18291815 unsigned i = 0 ;
18301816 for (auto privDecl : privateDecls) {
1831- if (!privatizerReadsSourceVariable ( privDecl)) {
1817+ if (!privDecl. readsFromMold ( )) {
18321818 // Handle this inside of the task so we don't pass unnessecary vars in
18331819 llvmPrivateVars.push_back (nullptr );
18341820 continue ;
@@ -1984,7 +1970,7 @@ convertOmpTaskOp(omp::TaskOp taskOp, llvm::IRBuilderBase &builder,
19841970 llvm::BasicBlock *privInitBlock = nullptr ;
19851971 for (auto [blockArg, privDecl, mlirPrivVar] :
19861972 llvm::zip_equal (privateBlockArgs, privateDecls, mlirPrivateVars)) {
1987- if (privatizerReadsSourceVariable ( privDecl))
1973+ if (privDecl. readsFromMold ( ))
19881974 // This is handled before the task executes
19891975 continue ;
19901976
0 commit comments