fixed dumping statistics

This commit is contained in:
ALEXks
2025-04-20 21:34:31 +03:00
parent cde49042ae
commit 06980ee344
2 changed files with 23 additions and 13 deletions

View File

@@ -14,13 +14,13 @@
#include "dvm.h"
#include "../DynamicAnalysis/gcov_info.h"
#include "../DynamicAnalysis/gCov_parser_func.h"
#include "PredictScheme.h"
#include "../Utils/SgUtils.h"
#include "../DirectiveProcessing/directive_parser.h"
#include "../Distribution/DvmhDirective.h"
#include "../GraphLoop/graph_loops_func.h"
#include "../ExpressionTransform/expr_transform.h"
#include "../DirectiveProcessing/directive_parser.h"
#include "../LoopAnalyzer/loop_analyzer.h"
#include "../CFGraph/CFGraph.h"
@@ -215,6 +215,8 @@ void calculateStatsForPredictor(const map<string, vector<FuncInfo*>>& allFuncInf
if (loop->variant() != FOR_NODE)
printInternalError(convertFileName(__FILE__).c_str(), __LINE__);
if (__gcov_doesThisLineExecuted(byFile.first, loop->lineNumber()))
{
calculateForParallelLoop(loop, gcov, paralle_exec, lines_count);
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);
}
}
}
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;
int line = st->lineNumber();
@@ -428,6 +432,7 @@ static void parallelDir(const map<DIST::Array*, int>& byPos, SgExpression* spec,
parallel["loops_count"] = loopSymbs.size();
SgStatement* loop = isSgForStmt(st->lexNext());
if (loop == NULL)
printInternalError(convertFileName(__FILE__).c_str(), __LINE__);
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)
if (execs[z - 1] != 0)
execs[z] /= execs[z - 1];
auto& info = getInfo(before, gcov);
if (info.getExecutedCount())
execs[0] /= info.getExecutedCount();
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())
{
if (!__gcov_doesThisLineExecuted(byFile.first, st->lineNumber()))
continue;
SgExpression* list;
SgExpression* dup;
auto line = 0;

View File

@@ -1,3 +1,3 @@
#pragma once
#define VERSION_SPF "2409"
#define VERSION_SPF "2410"