Merge branch 'master' into analyze_loops_with_IR
This commit is contained in:
@@ -250,7 +250,7 @@ static set<SAPFOR::BasicBlock*> analyzeLoop(LoopGraph* loop, const set<SAPFOR::B
|
|||||||
const map<string, SgSymbol*>& commonArgs, FuncInfo* func,
|
const map<string, SgSymbol*>& commonArgs, FuncInfo* func,
|
||||||
map<string, vector<Messages>>& messages)
|
map<string, vector<Messages>>& messages)
|
||||||
{
|
{
|
||||||
if (!loop->isFor)
|
if (!loop->isFor())
|
||||||
printInternalError(convertFileName(__FILE__).c_str(), __LINE__); //should be called only with FOR loops
|
printInternalError(convertFileName(__FILE__).c_str(), __LINE__); //should be called only with FOR loops
|
||||||
|
|
||||||
SgStatement* loop_operator = loop->loop->GetOriginal();
|
SgStatement* loop_operator = loop->loop->GetOriginal();
|
||||||
@@ -450,7 +450,7 @@ static void recAnalyzeLoop(LoopGraph* loop, const set<SAPFOR::BasicBlock*>& bloc
|
|||||||
const map<string, SgSymbol*>& commonArgs,
|
const map<string, SgSymbol*>& commonArgs,
|
||||||
FuncInfo* func, map<string, vector<Messages>>& messages)
|
FuncInfo* func, map<string, vector<Messages>>& messages)
|
||||||
{
|
{
|
||||||
const auto& loop_body = loop->isFor ? analyzeLoop(loop, blocks, commonVars, commonArgs, func, messages) : blocks;
|
const auto& loop_body = loop->isFor() ? analyzeLoop(loop, blocks, commonVars, commonArgs, func, messages) : blocks;
|
||||||
|
|
||||||
for (const auto& inner_loop : loop->children)
|
for (const auto& inner_loop : loop->children)
|
||||||
recAnalyzeLoop(inner_loop, loop_body, commonVars, commonArgs, func, messages);
|
recAnalyzeLoop(inner_loop, loop_body, commonVars, commonArgs, func, messages);
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ static LoopGraph* createDirectiveForLoop(LoopGraph *currentLoop, MapToArray &mai
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
directive->parallel.push_back(currentLoop->loopSymbol);
|
directive->parallel.push_back(currentLoop->loopSymbol());
|
||||||
directive->arrayRef = mainArray.arrayRef;
|
directive->arrayRef = mainArray.arrayRef;
|
||||||
|
|
||||||
DIST::Array *tmp = mainArray.arrayRef;
|
DIST::Array *tmp = mainArray.arrayRef;
|
||||||
@@ -84,7 +84,7 @@ static LoopGraph* createDirectiveForLoop(LoopGraph *currentLoop, MapToArray &mai
|
|||||||
for (int i = 0; i < tmp->GetDimSize(); ++i)
|
for (int i = 0; i < tmp->GetDimSize(); ++i)
|
||||||
{
|
{
|
||||||
if (i == pos)
|
if (i == pos)
|
||||||
directive->on.push_back(make_pair(currentLoop->loopSymbol, mainAccess));
|
directive->on.push_back(make_pair(currentLoop->loopSymbol(), mainAccess));
|
||||||
else
|
else
|
||||||
directive->on.push_back(make_pair("*", make_pair(0, 0)));
|
directive->on.push_back(make_pair("*", make_pair(0, 0)));
|
||||||
}
|
}
|
||||||
@@ -808,7 +808,7 @@ void createParallelDirectives(const map<LoopGraph*, map<DIST::Array*, ArrayInfo*
|
|||||||
for (int i = 0; i < mainArrayOfLoop->GetDimSize(); ++i)
|
for (int i = 0; i < mainArrayOfLoop->GetDimSize(); ++i)
|
||||||
{
|
{
|
||||||
if (i == dimPos)
|
if (i == dimPos)
|
||||||
parDir->on2.push_back(make_pair(currLoop->loopSymbol, mainAccess));
|
parDir->on2.push_back(make_pair(currLoop->loopSymbol(), mainAccess));
|
||||||
else
|
else
|
||||||
parDir->on2.push_back(make_pair("*", make_pair(0, 0)));
|
parDir->on2.push_back(make_pair("*", make_pair(0, 0)));
|
||||||
}
|
}
|
||||||
@@ -1100,7 +1100,7 @@ static bool tryToResolveUnmatchedDims(const map<DIST::Array*, vector<bool>> &dim
|
|||||||
LoopGraph* tmpL = loop;
|
LoopGraph* tmpL = loop;
|
||||||
for (int z = 0; z < nested; ++z)
|
for (int z = 0; z < nested; ++z)
|
||||||
{
|
{
|
||||||
deprecateToMatch.insert(tmpL->loopSymbol);
|
deprecateToMatch.insert(tmpL->loopSymbol());
|
||||||
if (tmpL->children.size())
|
if (tmpL->children.size())
|
||||||
tmpL = tmpL->children[0];
|
tmpL = tmpL->children[0];
|
||||||
else if (z != nested - 1)
|
else if (z != nested - 1)
|
||||||
@@ -1113,7 +1113,7 @@ static bool tryToResolveUnmatchedDims(const map<DIST::Array*, vector<bool>> &dim
|
|||||||
tmpL = loop->parent;
|
tmpL = loop->parent;
|
||||||
while (tmpL)
|
while (tmpL)
|
||||||
{
|
{
|
||||||
if (!tmpL->isFor) // TODO: need to add all inductive variables!
|
if (tmpL->isWhile()) // TODO: need to add all inductive variables!
|
||||||
{
|
{
|
||||||
SgWhileStmt* dow = isSgWhileStmt(tmpL->loop->GetOriginal());
|
SgWhileStmt* dow = isSgWhileStmt(tmpL->loop->GetOriginal());
|
||||||
if (dow->conditional())
|
if (dow->conditional())
|
||||||
@@ -1124,7 +1124,7 @@ static bool tryToResolveUnmatchedDims(const map<DIST::Array*, vector<bool>> &dim
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
deprecateToMatch.insert(tmpL->loopSymbol);
|
deprecateToMatch.insert(tmpL->loopSymbol());
|
||||||
tmpL = tmpL->parent;
|
tmpL = tmpL->parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -346,7 +346,7 @@ static vector<SgExpression*>
|
|||||||
{
|
{
|
||||||
needToAdd = true;
|
needToAdd = true;
|
||||||
dim_found = true;
|
dim_found = true;
|
||||||
subs[i] = new SgVarRefExp(findSymbolOrCreate(file, currLoop->loopSymbol));
|
subs[i] = new SgVarRefExp(findSymbolOrCreate(file, currLoop->loopSymbol()));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -699,7 +699,12 @@ void loopGraphAnalyzer(SgFile *file, vector<LoopGraph*> &loopGraph, const vector
|
|||||||
newLoop->hasPrints = hasThisIds(st, newLoop->linesOfIO, { WRITE_STAT, READ_STAT, OPEN_STAT, CLOSE_STAT, PRINT_STAT } ); // FORMAT_STAT
|
newLoop->hasPrints = hasThisIds(st, newLoop->linesOfIO, { WRITE_STAT, READ_STAT, OPEN_STAT, CLOSE_STAT, PRINT_STAT } ); // FORMAT_STAT
|
||||||
newLoop->hasStops = hasThisIds(st, newLoop->linesOfStop, { STOP_STAT, PAUSE_NODE });
|
newLoop->hasStops = hasThisIds(st, newLoop->linesOfStop, { STOP_STAT, PAUSE_NODE });
|
||||||
newLoop->hasDvmIntervals = hasThisIds(st, tmpLines, { DVM_INTERVAL_DIR, DVM_ENDINTERVAL_DIR, DVM_EXIT_INTERVAL_DIR });
|
newLoop->hasDvmIntervals = hasThisIds(st, tmpLines, { DVM_INTERVAL_DIR, DVM_ENDINTERVAL_DIR, DVM_EXIT_INTERVAL_DIR });
|
||||||
newLoop->isFor = isSgForStmt(st) ? true : false;
|
if (isSgForStmt(st))
|
||||||
|
newLoop->loopType = LoopType::FOR;
|
||||||
|
else if (isSgWhileStmt(st))
|
||||||
|
newLoop->loopType = LoopType::WHILE;
|
||||||
|
else
|
||||||
|
newLoop->loopType = LoopType::NONE;
|
||||||
newLoop->inCanonicalFrom = isSgForStmt(st) ? true : false;
|
newLoop->inCanonicalFrom = isSgForStmt(st) ? true : false;
|
||||||
newLoop->hasSubstringRefs = hasSubstringRef(st);
|
newLoop->hasSubstringRefs = hasSubstringRef(st);
|
||||||
|
|
||||||
@@ -777,7 +782,7 @@ void loopGraphAnalyzer(SgFile *file, vector<LoopGraph*> &loopGraph, const vector
|
|||||||
newLoop->startEndExpr = std::make_pair((Expression*)NULL, (Expression*)NULL);
|
newLoop->startEndExpr = std::make_pair((Expression*)NULL, (Expression*)NULL);
|
||||||
|
|
||||||
newLoop->loop = new Statement(st);
|
newLoop->loop = new Statement(st);
|
||||||
newLoop->loopSymbol = st->symbol() ? st->symbol()->identifier() : "unknown";
|
newLoop->loopSymbols.addMainVar(st->symbol() ? st->symbol()->identifier() : "unknown");
|
||||||
findArrayRefs(newLoop);
|
findArrayRefs(newLoop);
|
||||||
|
|
||||||
SgStatement *lexPrev = st->lexPrev();
|
SgStatement *lexPrev = st->lexPrev();
|
||||||
|
|||||||
@@ -25,6 +25,33 @@ namespace DIST = Distribution;
|
|||||||
void getRealArrayRefs(DIST::Array* addTo, DIST::Array* curr, std::set<DIST::Array*>& realArrayRefs, const std::map<DIST::Array*, std::set<DIST::Array*>>& arrayLinksByFuncCalls);
|
void getRealArrayRefs(DIST::Array* addTo, DIST::Array* curr, std::set<DIST::Array*>& realArrayRefs, const std::map<DIST::Array*, std::set<DIST::Array*>>& arrayLinksByFuncCalls);
|
||||||
void getAllArrayRefs(DIST::Array* addTo, DIST::Array* curr, std::set<DIST::Array*>& realArrayRefs, const std::map<DIST::Array*, std::set<DIST::Array*>>& arrayLinksByFuncCalls);
|
void getAllArrayRefs(DIST::Array* addTo, DIST::Array* curr, std::set<DIST::Array*>& realArrayRefs, const std::map<DIST::Array*, std::set<DIST::Array*>>& arrayLinksByFuncCalls);
|
||||||
|
|
||||||
|
enum class LoopType { NONE, FOR, WHILE, IMPLICIT };
|
||||||
|
|
||||||
|
struct InductiveVariables
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
std::string mainVar;
|
||||||
|
std::set<std::string> allVars;
|
||||||
|
|
||||||
|
public:
|
||||||
|
InductiveVariables() { }
|
||||||
|
|
||||||
|
explicit InductiveVariables(const std::string& mainVar, const std::set<std::string>& allVars) : mainVar(mainVar), allVars(allVars) { };
|
||||||
|
|
||||||
|
std::string getMainVar() const { return mainVar; }
|
||||||
|
std::set<std::string> getAllVars() const { return allVars; }
|
||||||
|
|
||||||
|
void addVar(const std::string& var) { allVars.insert(var); }
|
||||||
|
void addMainVar(const std::string& var) { mainVar = var; allVars.insert(var); }
|
||||||
|
|
||||||
|
void replaceMainVar(const std::string& var)
|
||||||
|
{
|
||||||
|
allVars.erase(mainVar);
|
||||||
|
|
||||||
|
addMainVar(var);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
struct LoopGraph
|
struct LoopGraph
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
@@ -70,7 +97,7 @@ public:
|
|||||||
calculatedCountOfIters = 0;
|
calculatedCountOfIters = 0;
|
||||||
executionTimeInSec = -1.0;
|
executionTimeInSec = -1.0;
|
||||||
inDvmhRegion = 0;
|
inDvmhRegion = 0;
|
||||||
isFor = false;
|
loopType = LoopType::NONE;
|
||||||
inCanonicalFrom = false;
|
inCanonicalFrom = false;
|
||||||
hasAccessToSubArray = false;
|
hasAccessToSubArray = false;
|
||||||
hasSubstringRefs = false;
|
hasSubstringRefs = false;
|
||||||
@@ -113,21 +140,24 @@ public:
|
|||||||
{
|
{
|
||||||
return hasUnknownArrayDep || hasUnknownScalarDep || hasGoto || hasPrints || (hasConflicts.size() != 0) || hasStops || hasNonPureProcedures ||
|
return hasUnknownArrayDep || hasUnknownScalarDep || hasGoto || hasPrints || (hasConflicts.size() != 0) || hasStops || hasNonPureProcedures ||
|
||||||
hasUnknownArrayAssigns || hasNonRectangularBounds || hasIndirectAccess || hasWritesToNonDistribute || hasDifferentAlignRules || hasDvmIntervals ||
|
hasUnknownArrayAssigns || hasNonRectangularBounds || hasIndirectAccess || hasWritesToNonDistribute || hasDifferentAlignRules || hasDvmIntervals ||
|
||||||
!isFor || lastprivateScalars.size() || hasAccessToSubArray || hasSubstringRefs;
|
!isFor() || lastprivateScalars.size() || hasAccessToSubArray || hasSubstringRefs;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool hasLimitsToSplit() const
|
bool hasLimitsToSplit() const
|
||||||
{
|
{
|
||||||
return hasGoto || hasStops || !isFor || hasPrints;
|
return hasGoto || hasStops || !isFor() || hasPrints;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool hasLimitsToCombine() const
|
bool hasLimitsToCombine() const
|
||||||
{
|
{
|
||||||
return hasGoto || hasStops || !isFor || hasPrints || linesOfCycle.size();
|
return hasGoto || hasStops || !isFor() || hasPrints || linesOfCycle.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
void addConflictMessages(std::vector<Messages> *messages)
|
void addConflictMessages(std::vector<Messages> *messages)
|
||||||
{
|
{
|
||||||
|
if (messages == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
const int line = altLineNum > 0 ? altLineNum : lineNum;
|
const int line = altLineNum > 0 ? altLineNum : lineNum;
|
||||||
if (hasUnknownArrayDep)
|
if (hasUnknownArrayDep)
|
||||||
messages->push_back(Messages(NOTE, line, R113, L"unknown array dependency prevents parallelization of this loop", 3006));
|
messages->push_back(Messages(NOTE, line, R113, L"unknown array dependency prevents parallelization of this loop", 3006));
|
||||||
@@ -168,7 +198,7 @@ public:
|
|||||||
if (hasDvmIntervals)
|
if (hasDvmIntervals)
|
||||||
messages->push_back(Messages(NOTE, line, R145, L"DVM intervals prevent parallelization of this loop", 3006));
|
messages->push_back(Messages(NOTE, line, R145, L"DVM intervals prevent parallelization of this loop", 3006));
|
||||||
|
|
||||||
if (!isFor || !inCanonicalFrom)
|
if (!isFor() || !inCanonicalFrom)
|
||||||
messages->push_back(Messages(NOTE, line, R178, L"This type of loop is not supported by the system", 3006));
|
messages->push_back(Messages(NOTE, line, R178, L"This type of loop is not supported by the system", 3006));
|
||||||
|
|
||||||
if (lastprivateScalars.size())
|
if (lastprivateScalars.size())
|
||||||
@@ -393,6 +423,14 @@ public:
|
|||||||
|
|
||||||
void* getRealStat(const char* file) const;
|
void* getRealStat(const char* file) const;
|
||||||
|
|
||||||
|
bool isFor() const { return loopType == LoopType::FOR; }
|
||||||
|
|
||||||
|
bool isWhile() const { return loopType == LoopType::WHILE; }
|
||||||
|
|
||||||
|
bool isImplicit() const { return loopType == LoopType::IMPLICIT; }
|
||||||
|
|
||||||
|
std::string loopSymbol() const { return loopSymbols.getMainVar(); }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
int lineNum;
|
int lineNum;
|
||||||
int altLineNum;
|
int altLineNum;
|
||||||
@@ -407,7 +445,7 @@ public:
|
|||||||
int startVal, endVal, stepVal;
|
int startVal, endVal, stepVal;
|
||||||
std::tuple<Expression*, Expression*, Expression*> startEndStepVals;
|
std::tuple<Expression*, Expression*, Expression*> startEndStepVals;
|
||||||
|
|
||||||
std::string loopSymbol;
|
InductiveVariables loopSymbols;
|
||||||
std::pair<Expression*, Expression*> startEndExpr;
|
std::pair<Expression*, Expression*> startEndExpr;
|
||||||
|
|
||||||
bool hasGoto;
|
bool hasGoto;
|
||||||
@@ -448,7 +486,7 @@ public:
|
|||||||
|
|
||||||
bool hasSubstringRefs;
|
bool hasSubstringRefs;
|
||||||
|
|
||||||
bool isFor;
|
LoopType loopType;
|
||||||
|
|
||||||
bool inCanonicalFrom;
|
bool inCanonicalFrom;
|
||||||
|
|
||||||
|
|||||||
@@ -551,7 +551,7 @@ void addToDistributionGraph(const map<LoopGraph*, map<DIST::Array*, ArrayInfo*>>
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!loopAccess.first->isFor)
|
if (!loopAccess.first->isFor())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
DIST::GraphCSR<int, double, attrType>& G = currReg->GetGraphToModify();
|
DIST::GraphCSR<int, double, attrType>& G = currReg->GetGraphToModify();
|
||||||
@@ -775,7 +775,7 @@ static void isAllOk(const vector<LoopGraph*> &loops, vector<Messages> &currMessa
|
|||||||
{
|
{
|
||||||
if (loops[i]->region)
|
if (loops[i]->region)
|
||||||
{
|
{
|
||||||
if (loops[i]->countOfIters == 0 && loops[i]->region && loops[i]->isFor)
|
if (loops[i]->countOfIters == 0 && loops[i]->region && loops[i]->isFor())
|
||||||
{
|
{
|
||||||
wstring bufE, bufR;
|
wstring bufE, bufR;
|
||||||
__spf_printToLongBuf(bufE, L" Can not calculate count of iterations for this loop, information about iterations in all loops in parallel regions '%s' will be ignored",
|
__spf_printToLongBuf(bufE, L" Can not calculate count of iterations for this loop, information about iterations in all loops in parallel regions '%s' will be ignored",
|
||||||
|
|||||||
@@ -2199,7 +2199,7 @@ void loopAnalyzer(SgFile *file, vector<ParallelRegion*> ®ions, map<tuple<int,
|
|||||||
LoopGraph *tmpLoop = new LoopGraph();
|
LoopGraph *tmpLoop = new LoopGraph();
|
||||||
|
|
||||||
tmpLoop->region = reg;
|
tmpLoop->region = reg;
|
||||||
tmpLoop->isFor = true;
|
tmpLoop->loopType = LoopType::FOR;
|
||||||
|
|
||||||
tmpLoops.push_back(tmpLoop);
|
tmpLoops.push_back(tmpLoop);
|
||||||
|
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ pair<SAPFOR::BasicBlock*, unordered_set<SAPFOR::BasicBlock*>> GetBasicBlocksForL
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void BuildLoopIndex(map<string, LoopGraph*>& loopForIndex, LoopGraph* loop) {
|
static void BuildLoopIndex(map<string, LoopGraph*>& loopForIndex, LoopGraph* loop) {
|
||||||
string index = loop->loopSymbol;
|
string index = loop->loopSymbol();
|
||||||
loopForIndex[index] = loop;
|
loopForIndex[index] = loop;
|
||||||
|
|
||||||
for (const auto& childLoop : loop->children)
|
for (const auto& childLoop : loop->children)
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ using std::wstring;
|
|||||||
|
|
||||||
static SgSymbol* getLoopSymbol(const LoopGraph* loop)
|
static SgSymbol* getLoopSymbol(const LoopGraph* loop)
|
||||||
{
|
{
|
||||||
if (!loop || !loop->isFor)
|
if (!loop || !loop->isFor())
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
SgForStmt* stmt = (SgForStmt*)loop->loop->GetOriginal();
|
SgForStmt* stmt = (SgForStmt*)loop->loop->GetOriginal();
|
||||||
@@ -667,12 +667,12 @@ static void renameIterationVariables(LoopGraph* loop, const map<SgSymbol*, SgSym
|
|||||||
{
|
{
|
||||||
if (loop)
|
if (loop)
|
||||||
{
|
{
|
||||||
string& loopName = loop->loopSymbol;
|
const string& loopName = loop->loopSymbol();
|
||||||
for (auto& pair : symbols)
|
for (auto& [from, to] : symbols)
|
||||||
{
|
{
|
||||||
if (pair.first->identifier() == loopName)
|
if (from->identifier() == loopName)
|
||||||
{
|
{
|
||||||
loop->loopSymbol = (string)pair.second->identifier();
|
loop->loopSymbols.replaceMainVar(to->identifier());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -691,9 +691,9 @@ static void renameVariablesInLoop(LoopGraph* loop, const map<SgSymbol*, SgSymbol
|
|||||||
if (st->variant() == FOR_NODE)
|
if (st->variant() == FOR_NODE)
|
||||||
{
|
{
|
||||||
SgForStmt* for_st = (SgForStmt*)st;
|
SgForStmt* for_st = (SgForStmt*)st;
|
||||||
for (auto& pair : symbols)
|
for (auto& [from, to] : symbols)
|
||||||
if (isEqSymbols(pair.first, for_st->symbol()))
|
if (isEqSymbols(from, for_st->symbol()))
|
||||||
for_st->setDoName(*pair.second);
|
for_st->setDoName(*to);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < 3; ++i)
|
for (int i = 0; i < 3; ++i)
|
||||||
@@ -710,12 +710,12 @@ static void renamePrivatesInMap(LoopGraph* loop, const map<SgSymbol*, SgSymbol*>
|
|||||||
for (auto& priv : privates->second)
|
for (auto& priv : privates->second)
|
||||||
{
|
{
|
||||||
bool found = false;
|
bool found = false;
|
||||||
for (auto& pair : symbols)
|
for (auto& [from, to] : symbols)
|
||||||
{
|
{
|
||||||
if (isEqSymbols(priv, pair.first))
|
if (isEqSymbols(priv, from))
|
||||||
{
|
{
|
||||||
found = true;
|
found = true;
|
||||||
newList.insert(pair.second);
|
newList.insert(to);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1590,7 +1590,7 @@ static bool combine(LoopGraph* firstLoop, const vector<LoopGraph*>& nextLoops, s
|
|||||||
bool wasCombine = false;
|
bool wasCombine = false;
|
||||||
for (LoopGraph* loop : nextLoops)
|
for (LoopGraph* loop : nextLoops)
|
||||||
{
|
{
|
||||||
if (!loop->isFor)
|
if (!loop->isFor())
|
||||||
return wasCombine;
|
return wasCombine;
|
||||||
|
|
||||||
int perfectLoop = std::min(firstLoop->perfectLoop, loop->perfectLoop);
|
int perfectLoop = std::min(firstLoop->perfectLoop, loop->perfectLoop);
|
||||||
@@ -1723,7 +1723,7 @@ static bool tryToCombine(vector<LoopGraph*>& loopGraphs, map<LoopGraph*, set<SgS
|
|||||||
{
|
{
|
||||||
LoopGraph* loop = loops[z];
|
LoopGraph* loop = loops[z];
|
||||||
newloopGraphs.push_back(loop);
|
newloopGraphs.push_back(loop);
|
||||||
if (!loop->isFor)
|
if (!loop->isFor())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
vector<LoopGraph*> nextLoops = getNextLoops(loop, loopGraphs, -1);
|
vector<LoopGraph*> nextLoops = getNextLoops(loop, loopGraphs, -1);
|
||||||
|
|||||||
@@ -1035,7 +1035,7 @@ int splitLoops(SgFile *file, vector<LoopGraph*> &loopGraphs, vector<Messages> &m
|
|||||||
|
|
||||||
for (auto &loopPair : mapLoopGraph)
|
for (auto &loopPair : mapLoopGraph)
|
||||||
{
|
{
|
||||||
if (!loopPair.second->isFor)
|
if (!loopPair.second->isFor())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
LoopGraph *loop = loopPair.second;
|
LoopGraph *loop = loopPair.second;
|
||||||
|
|||||||
@@ -2257,7 +2257,7 @@ void removePrivatesAnalysis(string filename,
|
|||||||
{
|
{
|
||||||
for (LoopGraph* loop : loopGraphs)
|
for (LoopGraph* loop : loopGraphs)
|
||||||
{
|
{
|
||||||
if (!loop->isFor)
|
if (!loop->isFor())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
SgForStmt* loopStmt = (SgForStmt*)loop->loop->GetOriginal();
|
SgForStmt* loopStmt = (SgForStmt*)loop->loop->GetOriginal();
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ static void fillIterationVariables(const LoopGraph* loop, set<string>& vars, int
|
|||||||
{
|
{
|
||||||
if (dimensions == -1)
|
if (dimensions == -1)
|
||||||
{
|
{
|
||||||
vars.insert(loop->loopSymbol);
|
vars.insert(loop->loopSymbol());
|
||||||
for (LoopGraph* child : loop->children)
|
for (LoopGraph* child : loop->children)
|
||||||
fillIterationVariables(child, vars);
|
fillIterationVariables(child, vars);
|
||||||
}
|
}
|
||||||
@@ -82,7 +82,7 @@ static void fillIterationVariables(const LoopGraph* loop, set<string>& vars, int
|
|||||||
{
|
{
|
||||||
for (int i = 0; i < dimensions; ++i)
|
for (int i = 0; i < dimensions; ++i)
|
||||||
{
|
{
|
||||||
vars.insert(loop->loopSymbol);
|
vars.insert(loop->loopSymbol());
|
||||||
if (i != dimensions - 1)
|
if (i != dimensions - 1)
|
||||||
loop = loop->children[0];
|
loop = loop->children[0];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define VERSION_SPF "2430"
|
#define VERSION_SPF "2431"
|
||||||
|
|||||||
Reference in New Issue
Block a user