Compare commits
5 Commits
c26cc261c4
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a0cea2df91 | ||
|
|
4b7df86b8a | ||
| 836894fef1 | |||
| 9ac15eec79 | |||
| 03f565f50b |
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> FindPrivateArrays(map<string, vector<LoopGraph*>> &loopGraph, map<FuncInfo*, vector<SAPFOR::BasicBlock*>>& FullIR)
|
||||||
{
|
{
|
||||||
map<LoopGraph*, ArrayAccessingIndexes> result;
|
map<LoopGraph*, ArrayAccessingIndexes> result;
|
||||||
for (const auto& [loopName, loops] : loopGraph)
|
for (const auto& [fileName, loops] : loopGraph)
|
||||||
{
|
{
|
||||||
|
SgFile::switchToFile(fileName);
|
||||||
for (const auto& loop : loops)
|
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)
|
for (const auto& [funcInfo, blocks]: FullIR)
|
||||||
|
{
|
||||||
|
if (funcInfo->fileName == fileName && funcInfo->funcPointer->GetOriginal() == search_func)
|
||||||
{
|
{
|
||||||
Region* loopRegion = new Region(loop, blocks);
|
Region* loopRegion = new Region(loop, blocks);
|
||||||
|
if (loopRegion->getBasickBlocks().size() <= 1)
|
||||||
|
{
|
||||||
|
delete(loopRegion);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
SolveDataFlow(loopRegion);
|
SolveDataFlow(loopRegion);
|
||||||
result[loop] = loopRegion->array_priv;
|
result[loop] = loopRegion->array_priv;
|
||||||
delete(loopRegion);
|
delete(loopRegion);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1019,8 +1019,6 @@ static bool runAnalysis(SgProject &project, const int curr_regime, const bool ne
|
|||||||
if(func->funcPointer->variant() != ENTRY_STAT)
|
if(func->funcPointer->variant() != ENTRY_STAT)
|
||||||
countOfTransform += removeDeadCode(func->funcPointer, allFuncInfo, commonBlocks);
|
countOfTransform += removeDeadCode(func->funcPointer, allFuncInfo, commonBlocks);
|
||||||
}
|
}
|
||||||
else if (curr_regime == FIND_PRIVATE_ARRAYS)
|
|
||||||
FindPrivateArrays(loopGraph, fullIR);
|
|
||||||
else if (curr_regime == TEST_PASS)
|
else if (curr_regime == TEST_PASS)
|
||||||
{
|
{
|
||||||
//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)
|
else if (curr_regime == TRANSFORM_ASSUMED_SIZE_PARAMETERS)
|
||||||
transformAssumedSizeParameters(allFuncInfo);
|
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 elapsed = duration_cast<milliseconds>(high_resolution_clock::now() - timeForPass).count() / 1000.;
|
||||||
const float elapsedGlobal = duration_cast<milliseconds>(high_resolution_clock::now() - globalTime).count() / 1000.;
|
const float elapsedGlobal = duration_cast<milliseconds>(high_resolution_clock::now() - globalTime).count() / 1000.;
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define VERSION_SPF "2446"
|
#define VERSION_SPF "2447"
|
||||||
|
|||||||
@@ -1793,6 +1793,13 @@ int SPF_RenameIncludes(void*& context, int winHandler, short* options, short* pr
|
|||||||
return simpleTransformPass(RENAME_INLCUDES, options, projName, folderName, output, outputMessage);
|
return simpleTransformPass(RENAME_INLCUDES, options, projName, folderName, output, outputMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int SPF_InsertPrivateArrayDirectives(void*& context, int winHandler, short* options, short* projName, short* folderName, string& output, string& outputMessage)
|
||||||
|
{
|
||||||
|
MessageManager::clearCache();
|
||||||
|
MessageManager::setWinHandler(winHandler);
|
||||||
|
return simpleTransformPass(FIND_PRIVATE_ARRAYS, options, projName, folderName, output, outputMessage);
|
||||||
|
}
|
||||||
|
|
||||||
static inline void convertBackSlash(char *str, int strL)
|
static inline void convertBackSlash(char *str, int strL)
|
||||||
{
|
{
|
||||||
for (int z = 0; z < strL; ++z)
|
for (int z = 0; z < strL; ++z)
|
||||||
@@ -2499,6 +2506,8 @@ const wstring Sapfor_RunTransformation(const char* transformName_c, const char*
|
|||||||
retCode = SPF_InsertImplicitNone(context, winHandler, optSh, projSh, fold, output, outputMessage);
|
retCode = SPF_InsertImplicitNone(context, winHandler, optSh, projSh, fold, output, outputMessage);
|
||||||
else if (whichRun == "SPF_RenameIncludes")
|
else if (whichRun == "SPF_RenameIncludes")
|
||||||
retCode = SPF_RenameIncludes(context, winHandler, optSh, projSh, fold, output, outputMessage);
|
retCode = SPF_RenameIncludes(context, winHandler, optSh, projSh, fold, output, outputMessage);
|
||||||
|
else if (whichRun == "SPF_InsertPrivateArrayDirectives")
|
||||||
|
retCode = SPF_InsertPrivateArrayDirectives(context, winHandler, optSh, projSh, fold, output, outputMessage);
|
||||||
else if (whichRun == "SPF_CreateParallelVariant")
|
else if (whichRun == "SPF_CreateParallelVariant")
|
||||||
{
|
{
|
||||||
vector<string> splited;
|
vector<string> splited;
|
||||||
|
|||||||
Reference in New Issue
Block a user