fixed dumping statistics
This commit is contained in:
@@ -14,13 +14,13 @@
|
|||||||
|
|
||||||
#include "dvm.h"
|
#include "dvm.h"
|
||||||
#include "../DynamicAnalysis/gcov_info.h"
|
#include "../DynamicAnalysis/gcov_info.h"
|
||||||
|
#include "../DynamicAnalysis/gCov_parser_func.h"
|
||||||
#include "PredictScheme.h"
|
#include "PredictScheme.h"
|
||||||
#include "../Utils/SgUtils.h"
|
#include "../Utils/SgUtils.h"
|
||||||
#include "../DirectiveProcessing/directive_parser.h"
|
#include "../DirectiveProcessing/directive_parser.h"
|
||||||
#include "../Distribution/DvmhDirective.h"
|
#include "../Distribution/DvmhDirective.h"
|
||||||
#include "../GraphLoop/graph_loops_func.h"
|
#include "../GraphLoop/graph_loops_func.h"
|
||||||
#include "../ExpressionTransform/expr_transform.h"
|
#include "../ExpressionTransform/expr_transform.h"
|
||||||
#include "../DirectiveProcessing/directive_parser.h"
|
|
||||||
#include "../LoopAnalyzer/loop_analyzer.h"
|
#include "../LoopAnalyzer/loop_analyzer.h"
|
||||||
#include "../CFGraph/CFGraph.h"
|
#include "../CFGraph/CFGraph.h"
|
||||||
|
|
||||||
@@ -215,6 +215,8 @@ void calculateStatsForPredictor(const map<string, vector<FuncInfo*>>& allFuncInf
|
|||||||
if (loop->variant() != FOR_NODE)
|
if (loop->variant() != FOR_NODE)
|
||||||
printInternalError(convertFileName(__FILE__).c_str(), __LINE__);
|
printInternalError(convertFileName(__FILE__).c_str(), __LINE__);
|
||||||
|
|
||||||
|
if (__gcov_doesThisLineExecuted(byFile.first, loop->lineNumber()))
|
||||||
|
{
|
||||||
calculateForParallelLoop(loop, gcov, paralle_exec, lines_count);
|
calculateForParallelLoop(loop, gcov, paralle_exec, lines_count);
|
||||||
st = loop->lastNodeOfStmt();
|
st = loop->lastNodeOfStmt();
|
||||||
|
|
||||||
@@ -225,10 +227,12 @@ void calculateStatsForPredictor(const map<string, vector<FuncInfo*>>& allFuncInf
|
|||||||
loop->lineNumber(), byFile.first.c_str(), paralle_exec, lines_count, paralle_exec / (double)lines_count);
|
loop->lineNumber(), byFile.first.c_str(), paralle_exec, lines_count, paralle_exec / (double)lines_count);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (auto st = stat->lexNext(); st != stat->lastNodeOfStmt(); st = st->lexNext())
|
for (auto st = stat->lexNext(); st != stat->lastNodeOfStmt(); st = st->lexNext())
|
||||||
{
|
{
|
||||||
if (!isSgExecutableStatement(st) || isDVM_stat(st) || isSPF_stat(st))
|
if (!isSgExecutableStatement(st) || isDVM_stat(st) || isSPF_stat(st) ||
|
||||||
|
!__gcov_doesThisLineExecuted(byFile.first, st->lineNumber()))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
int line = st->lineNumber();
|
int line = st->lineNumber();
|
||||||
@@ -428,6 +432,7 @@ static void parallelDir(const map<DIST::Array*, int>& byPos, SgExpression* spec,
|
|||||||
parallel["loops_count"] = loopSymbs.size();
|
parallel["loops_count"] = loopSymbs.size();
|
||||||
|
|
||||||
SgStatement* loop = isSgForStmt(st->lexNext());
|
SgStatement* loop = isSgForStmt(st->lexNext());
|
||||||
|
|
||||||
if (loop == NULL)
|
if (loop == NULL)
|
||||||
printInternalError(convertFileName(__FILE__).c_str(), __LINE__);
|
printInternalError(convertFileName(__FILE__).c_str(), __LINE__);
|
||||||
SgStatement* lastNode = loop->lastNodeOfStmt();
|
SgStatement* lastNode = loop->lastNodeOfStmt();
|
||||||
@@ -445,9 +450,11 @@ static void parallelDir(const map<DIST::Array*, int>& byPos, SgExpression* spec,
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (int z = execs.size() - 1; z > 0; --z)
|
for (int z = execs.size() - 1; z > 0; --z)
|
||||||
|
if (execs[z - 1] != 0)
|
||||||
execs[z] /= execs[z - 1];
|
execs[z] /= execs[z - 1];
|
||||||
|
|
||||||
auto& info = getInfo(before, gcov);
|
auto& info = getInfo(before, gcov);
|
||||||
|
if (info.getExecutedCount())
|
||||||
execs[0] /= info.getExecutedCount();
|
execs[0] /= info.getExecutedCount();
|
||||||
|
|
||||||
parallel["iterations_count"] = execs;
|
parallel["iterations_count"] = execs;
|
||||||
@@ -587,6 +594,9 @@ void parseDvmDirForPredictor(const map<tuple<int, string, string>, pair<DIST::Ar
|
|||||||
|
|
||||||
for (auto st = stat->lexNext(); st != stat->lastNodeOfStmt(); st = st->lexNext())
|
for (auto st = stat->lexNext(); st != stat->lastNodeOfStmt(); st = st->lexNext())
|
||||||
{
|
{
|
||||||
|
if (!__gcov_doesThisLineExecuted(byFile.first, st->lineNumber()))
|
||||||
|
continue;
|
||||||
|
|
||||||
SgExpression* list;
|
SgExpression* list;
|
||||||
SgExpression* dup;
|
SgExpression* dup;
|
||||||
auto line = 0;
|
auto line = 0;
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define VERSION_SPF "2409"
|
#define VERSION_SPF "2410"
|
||||||
|
|||||||
Reference in New Issue
Block a user