fixed predictor
This commit is contained in:
@@ -454,7 +454,7 @@ static void parallelDir(const map<DIST::Array*, int>& byPos, SgExpression* spec,
|
||||
execs[z] /= execs[z - 1];
|
||||
|
||||
auto& info = getInfo(before, gcov);
|
||||
if (info.getExecutedCount())
|
||||
if (info.getExecutedCount() && loopSymbs.size() > 1)
|
||||
execs[0] /= info.getExecutedCount();
|
||||
|
||||
parallel["iterations_count"] = execs;
|
||||
@@ -604,7 +604,10 @@ void parseDvmDirForPredictor(const map<tuple<int, string, string>, pair<DIST::Ar
|
||||
switch (st->variant())
|
||||
{
|
||||
case DVM_PARALLEL_ON_DIR:
|
||||
parallelDir(byPos, st->expr(2), st->expr(0)->symbol(), st->expr(0)->lhs(), st, st->expr(1), gcov, directives, commonBlocks, allFuncInfo);
|
||||
parallelDir(byPos, st->expr(2),
|
||||
st->expr(0) ? st->expr(0)->symbol() : NULL,
|
||||
st->expr(0) ? st->expr(0)->lhs() : NULL,
|
||||
st, st->expr(1), gcov, directives, commonBlocks, allFuncInfo);
|
||||
break;
|
||||
case DVM_VAR_DECL: // TODO
|
||||
{
|
||||
@@ -623,6 +626,7 @@ void parseDvmDirForPredictor(const map<tuple<int, string, string>, pair<DIST::Ar
|
||||
list = st->expr(0);
|
||||
while (list)
|
||||
{
|
||||
if (type->lhs()) // if ALIGN A(...) with B(...)
|
||||
directives["align"].push_back(parseAlign(byPos, list->lhs()->symbol(), type->rhs()->symbol(), type->lhs(), type->rhs()->lhs(), st->lineNumber()));
|
||||
list = list->rhs();
|
||||
}
|
||||
@@ -635,6 +639,9 @@ void parseDvmDirForPredictor(const map<tuple<int, string, string>, pair<DIST::Ar
|
||||
case DVM_ALIGN_DIR:
|
||||
directives["align"].push_back(parseAlign(byPos, st->expr(0)->lhs()->symbol(), st->expr(2)->symbol(), st->expr(1), st->expr(2)->lhs(), st->lineNumber()));
|
||||
break;
|
||||
case DVM_REALIGN_DIR:
|
||||
directives["realign"].push_back(parseAlign(byPos, st->expr(0)->lhs()->symbol(), st->expr(2)->symbol(), st->expr(1), st->expr(2)->lhs(), st->lineNumber()));
|
||||
break;
|
||||
case DVM_SHADOW_DIR:
|
||||
//dirs << "1;" << "SHADOW;" << st->expr(0)->unparse() << "(" << st->expr(1)->unparse() << ");\n";
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user