improved private arrays analysis

This commit is contained in:
ALEXks
2026-05-01 12:56:32 +03:00
parent e1bcaeba5c
commit 51f97e2be9
6 changed files with 52 additions and 29 deletions

View File

@@ -1036,24 +1036,6 @@ static bool runAnalysis(SgProject &project, const int curr_regime, const bool ne
if (internalExit < 0)
throw -1;
set<int> applyFor = { LOOPS_SPLITTER,
LOOPS_COMBINER,
PRIVATE_REMOVING,
PRIVATE_ARRAYS_EXPANSION,
PRIVATE_ARRAYS_SHRINKING,
REMOVE_DEAD_CODE,
MOVE_OPERATORS };
if ((countOfTransform == 0 || internalExit > 0) && applyFor.find(curr_regime) != applyFor.end())
{
SgStatement* mainUnit = findMainUnit(&project, SPF_messages);
checkNull(mainUnit, convertFileName(__FILE__).c_str(), __LINE__);
getObjectForFileFromMap(mainUnit->fileName(), SPF_messages).push_back(Messages(ERROR, mainUnit->lineNumber(), R197, L"Transformation cannot be performed - nothing to change", 2023));
__spf_print(1, "%d Transformation cannot be performed - nothing to change, count of transform %d, err %d\n", mainUnit->lineNumber(), countOfTransform, internalExit);
throw -11;
}
sendMessage_2lvl(2);
// ********************************** ///
/// SECOND AGGREGATION STEP ///
@@ -1904,8 +1886,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_ANALYSIS)
findPrivateArrays(loopGraph, fullIR, insertedPrivates, SPF_messages, declaredArrays);
else if (curr_regime == FIND_PRIVATE_ARRAYS_ANALYSIS)
countOfTransform = findPrivateArrays(loopGraph, fullIR, insertedPrivates, SPF_messages, declaredArrays);
else if (curr_regime == MERGE_REGIONS)
mergeRegions(parallelRegions, allFuncInfo);
else if (curr_regime == ARRAY_PROPAGATION)
@@ -1921,6 +1903,25 @@ static bool runAnalysis(SgProject &project, const int curr_regime, const bool ne
if (internalExit != 0)
throw -1;
set<int> applyFor = { LOOPS_SPLITTER,
LOOPS_COMBINER,
PRIVATE_REMOVING,
PRIVATE_ARRAYS_EXPANSION,
PRIVATE_ARRAYS_SHRINKING,
REMOVE_DEAD_CODE,
MOVE_OPERATORS,
FIND_PRIVATE_ARRAYS_ANALYSIS };
if ((countOfTransform == 0 || internalExit > 0) && applyFor.find(curr_regime) != applyFor.end())
{
SgStatement* mainUnit = findMainUnit(&project, SPF_messages);
checkNull(mainUnit, convertFileName(__FILE__).c_str(), __LINE__);
getObjectForFileFromMap(mainUnit->fileName(), SPF_messages).push_back(Messages(ERROR, mainUnit->lineNumber(), R197, L"Transformation cannot be performed - nothing to change", 2023));
__spf_print(1, "%d Transformation cannot be performed - nothing to change, count of transform %d, err %d\n", mainUnit->lineNumber(), countOfTransform, internalExit);
throw - 11;
}
return true;
}