updated version, fixed code style
This commit is contained in:
@@ -20,6 +20,7 @@ static void RemoveEmptyPoints(ArrayAccessingIndexes& container)
|
||||
{
|
||||
ArrayAccessingIndexes resultContainer;
|
||||
unordered_set<string> toRemove;
|
||||
|
||||
for (auto& [arrayName, accessingSet] : container)
|
||||
{
|
||||
vector<vector<ArrayDimension>> points;
|
||||
@@ -28,6 +29,7 @@ static void RemoveEmptyPoints(ArrayAccessingIndexes& container)
|
||||
if (!arrayPoint.empty())
|
||||
points.push_back(arrayPoint);
|
||||
}
|
||||
|
||||
if (points.size() < accessingSet.GetElements().size() && !points.empty())
|
||||
resultContainer[arrayName] = points;
|
||||
|
||||
@@ -36,13 +38,10 @@ static void RemoveEmptyPoints(ArrayAccessingIndexes& container)
|
||||
}
|
||||
|
||||
for (const string& name : toRemove)
|
||||
{
|
||||
container.erase(name);
|
||||
}
|
||||
|
||||
for (auto& [arrayName, accessingSet] : resultContainer)
|
||||
{
|
||||
container[arrayName] = accessingSet;
|
||||
}
|
||||
}
|
||||
|
||||
static void Collapse(Region* region)
|
||||
@@ -67,6 +66,7 @@ static void Collapse(Region* region)
|
||||
region->array_use[arrayName] = region->array_use[arrayName].Union(diff);
|
||||
}
|
||||
}
|
||||
|
||||
ArrayAccessingIndexes useUnion;
|
||||
for (auto& byBlock : region->getBasickBlocks())
|
||||
for (auto& [arrayName, arrayRanges] : byBlock->array_use)
|
||||
@@ -104,6 +104,7 @@ static void SolveDataFlowIteratively(Region* DFG)
|
||||
newIn.clear();
|
||||
continue;
|
||||
}
|
||||
|
||||
for (const auto& [arrayName, accessSet] : prevBlock->array_out)
|
||||
{
|
||||
if (newIn.find(arrayName) != newIn.end())
|
||||
@@ -116,6 +117,7 @@ static void SolveDataFlowIteratively(Region* DFG)
|
||||
|
||||
b->array_in = move(newIn);
|
||||
ArrayAccessingIndexes newOut;
|
||||
|
||||
if (b->array_def.empty())
|
||||
newOut = b->array_in;
|
||||
else if (b->array_in.empty())
|
||||
@@ -151,22 +153,20 @@ static void SolveDataFlow(Region* DFG)
|
||||
Collapse(DFG);
|
||||
}
|
||||
|
||||
unsigned long long CalculateLength(const AccessingSet& array)
|
||||
/*unsigned long long CalculateLength(const AccessingSet& array)
|
||||
{
|
||||
if (array.GetElements().empty())
|
||||
return 0;
|
||||
|
||||
unsigned long long result = 1;
|
||||
for (const auto& range : array.GetElements())
|
||||
{
|
||||
for (const auto& dim : range)
|
||||
{
|
||||
result *= (dim.step * dim.tripCount);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void AddPrivateArraysToLoop(LoopGraph* loop, const ArrayAccessingIndexes& privates, set<SgStatement*>& insertedPrivates)
|
||||
return result;
|
||||
}*/
|
||||
|
||||
static void AddPrivateArraysToLoop(LoopGraph* loop, const ArrayAccessingIndexes& privates, set<SgStatement*>& insertedPrivates)
|
||||
{
|
||||
SgStatement* spfStat = new SgStatement(SPF_ANALYSIS_DIR);
|
||||
spfStat->setlineNumber(loop->loop->lineNumber());
|
||||
|
||||
@@ -187,7 +187,6 @@ enum passes {
|
||||
FIND_PRIVATE_ARRAYS,
|
||||
|
||||
TRANSFORM_ASSUMED_SIZE_PARAMETERS,
|
||||
|
||||
ARRAY_PROPAGATION,
|
||||
|
||||
TEST_PASS,
|
||||
@@ -378,7 +377,6 @@ static void setPassValues()
|
||||
passNames[FIND_PRIVATE_ARRAYS] = "FIND_PRIVATE_ARRAYS";
|
||||
|
||||
passNames[TRANSFORM_ASSUMED_SIZE_PARAMETERS] = "TRANSFORM_ASSUMED_SIZE_PARAMETERS";
|
||||
|
||||
passNames[ARRAY_PROPAGATION] = "ARRAY_PROPAGATION";
|
||||
|
||||
passNames[TEST_PASS] = "TEST_PASS";
|
||||
|
||||
@@ -319,7 +319,6 @@ void InitPassesDependencies(map<passes, vector<passes>> &passDepsIn, set<passes>
|
||||
list({ CALL_GRAPH2, CALL_GRAPH, BUILD_IR, LOOP_GRAPH, LOOP_ANALYZER_DATA_DIST_S2 }) <= Pass(FIND_PRIVATE_ARRAYS_ANALYSIS);
|
||||
list({ FIND_PRIVATE_ARRAYS_ANALYSIS, CONVERT_LOOP_TO_ASSIGN, RESTORE_LOOP_FROM_ASSIGN, REVERT_SUBST_EXPR_RD }) <= Pass(FIND_PRIVATE_ARRAYS);
|
||||
|
||||
|
||||
passesIgnoreStateDone.insert({ CREATE_PARALLEL_DIRS, INSERT_PARALLEL_DIRS, INSERT_SHADOW_DIRS, EXTRACT_PARALLEL_DIRS,
|
||||
EXTRACT_SHADOW_DIRS, CREATE_REMOTES, UNPARSE_FILE, REMOVE_AND_CALC_SHADOW,
|
||||
REVERSE_CREATED_NESTED_LOOPS, PREDICT_SCHEME, CALCULATE_STATS_SCHEME, REVERT_SPF_DIRS, CLEAR_SPF_DIRS, TRANSFORM_SHADOW_IF_FULL,
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
#pragma once
|
||||
|
||||
#define VERSION_SPF "2448"
|
||||
#define VERSION_SPF "2449"
|
||||
|
||||
Reference in New Issue
Block a user