replace_io_arrays #67

Merged
Alexander_KS merged 5 commits from replace_io_arrays into master 2025-10-01 18:13:01 +00:00
Showing only changes of commit f35d7cb4bd - Show all commits

View File

@@ -17,6 +17,14 @@ using std::pair;
#define DEBUG_TRACE 0
static bool hasArrayRef(SgExpression* ex)
{
if (ex)
return isArrayRef(ex) || hasArrayRef(ex->lhs()) || hasArrayRef(ex->rhs());
return false;
}
static inline bool isArrayDeclaration(SgStatement* st)
{
return isSgDeclarationStatement(st) || isSgVarListDeclStmt(st) || isSgNestedVarListDeclStmt(st);
@@ -201,13 +209,17 @@ static bool populateDistributedIoArrays(map<SgSymbol*, set<SgStatement*>>& array
if (!arg)
return false;
if (!isArrayRef(arg))
return false;
if (arg->lhs())
if (hasArrayRef(arg))
{
if (isArrayRef(arg) && arg->lhs())
need_replace = true;
}
else
{
return false;
}
}
else
{
need_replace = true;
}