8 Commits

3 changed files with 18 additions and 6 deletions

View File

@@ -497,7 +497,7 @@ else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
endif() endif()
if(NOT CMAKE_BUILD_TYPE) if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
endif() endif()
endif() endif()

View File

@@ -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
{ {

View File

@@ -1,3 +1,3 @@
#pragma once #pragma once
#define VERSION_SPF "2445" #define VERSION_SPF "2446"