replace_io_arrays #67
@@ -17,6 +17,14 @@ using std::pair;
|
|||||||
|
|
||||||
#define DEBUG_TRACE 0
|
#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)
|
static inline bool isArrayDeclaration(SgStatement* st)
|
||||||
{
|
{
|
||||||
return isSgDeclarationStatement(st) || isSgVarListDeclStmt(st) || isSgNestedVarListDeclStmt(st);
|
return isSgDeclarationStatement(st) || isSgVarListDeclStmt(st) || isSgNestedVarListDeclStmt(st);
|
||||||
@@ -201,11 +209,15 @@ static bool populateDistributedIoArrays(map<SgSymbol*, set<SgStatement*>>& array
|
|||||||
if (!arg)
|
if (!arg)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!isArrayRef(arg))
|
if (hasArrayRef(arg))
|
||||||
|
{
|
||||||
|
if (isArrayRef(arg) && arg->lhs())
|
||||||
|
need_replace = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
if (arg->lhs())
|
|
||||||
need_replace = true;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user