Compare commits
10 Commits
767bc19739
...
private_ar
| Author | SHA1 | Date | |
|---|---|---|---|
| 9ac15eec79 | |||
| 03f565f50b | |||
| 47e2b961e2 | |||
|
|
b95b336372 | ||
| f35d7cb4bd | |||
| 54615e34d4 | |||
| 8752f4a139 | |||
| 453105d273 | |||
| cad0a0b217 | |||
| 9c0fd40e7b |
@@ -497,7 +497,7 @@ else()
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||
endif()
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
Submodule projects/dvm updated: 4b7ef11871...4d4041a081
@@ -124,18 +124,32 @@ static void SolveDataFlow(Region* DFG)
|
||||
map<LoopGraph*, ArrayAccessingIndexes> FindPrivateArrays(map<string, vector<LoopGraph*>> &loopGraph, map<FuncInfo*, vector<SAPFOR::BasicBlock*>>& FullIR)
|
||||
{
|
||||
map<LoopGraph*, ArrayAccessingIndexes> result;
|
||||
for (const auto& [loopName, loops] : loopGraph)
|
||||
for (const auto& [fileName, loops] : loopGraph)
|
||||
{
|
||||
SgFile::switchToFile(fileName);
|
||||
for (const auto& loop : loops)
|
||||
{
|
||||
SgStatement* search_func = loop->loop->GetOriginal();
|
||||
|
||||
while (search_func && (!isSgProgHedrStmt(search_func)))
|
||||
search_func = search_func->controlParent();
|
||||
|
||||
for (const auto& [funcInfo, blocks]: FullIR)
|
||||
{
|
||||
if (funcInfo->fileName == fileName && funcInfo->funcPointer->GetOriginal() == search_func)
|
||||
{
|
||||
Region* loopRegion = new Region(loop, blocks);
|
||||
if (loopRegion->getBasickBlocks().size() <= 1)
|
||||
{
|
||||
delete(loopRegion);
|
||||
continue;
|
||||
}
|
||||
SolveDataFlow(loopRegion);
|
||||
result[loop] = loopRegion->array_priv;
|
||||
delete(loopRegion);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1019,8 +1019,6 @@ static bool runAnalysis(SgProject &project, const int curr_regime, const bool ne
|
||||
if(func->funcPointer->variant() != ENTRY_STAT)
|
||||
countOfTransform += removeDeadCode(func->funcPointer, allFuncInfo, commonBlocks);
|
||||
}
|
||||
else if (curr_regime == FIND_PRIVATE_ARRAYS)
|
||||
FindPrivateArrays(loopGraph, fullIR);
|
||||
else if (curr_regime == TEST_PASS)
|
||||
{
|
||||
//test pass
|
||||
@@ -1916,6 +1914,8 @@ static bool runAnalysis(SgProject &project, const int curr_regime, const bool ne
|
||||
}
|
||||
else if (curr_regime == TRANSFORM_ASSUMED_SIZE_PARAMETERS)
|
||||
transformAssumedSizeParameters(allFuncInfo);
|
||||
else if (curr_regime == FIND_PRIVATE_ARRAYS)
|
||||
auto result = FindPrivateArrays(loopGraph, fullIR);
|
||||
|
||||
const float elapsed = duration_cast<milliseconds>(high_resolution_clock::now() - timeForPass).count() / 1000.;
|
||||
const float elapsedGlobal = duration_cast<milliseconds>(high_resolution_clock::now() - globalTime).count() / 1000.;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
#pragma once
|
||||
|
||||
#define VERSION_SPF "2445"
|
||||
#define VERSION_SPF "2446"
|
||||
|
||||
Reference in New Issue
Block a user