HomePhabricator

[gcov] Fix wrong line hit counts when multiple blocks are on the same line

Description

[gcov] Fix wrong line hit counts when multiple blocks are on the same line

Summary:
The goal of this patch is to have the same behaviour than gcc-gcov.
Currently the hit counts for a line is the sum of the counts for each block on that line.
The idea is to detect the cycles in the graph of blocks in using the algorithm by Hawick & James.
The count for a cycle is the min of the counts for each edge in the cycle.
Once we've the count for each cycle, we can sum them and add the transition counts of those cycles.

Fix both https://bugs.llvm.org/show_bug.cgi?id=38065 and https://bugs.llvm.org/show_bug.cgi?id=38066

Reviewers: marco-c, davidxl

Reviewed By: marco-c

Subscribers: vsk, lebedev.ri, sylvestre.ledru, dblaikie, llvm-commits

Differential Revision: https://reviews.llvm.org/D49659

Event Timeline

According to the logs, there is an issue in the # of Runs for each file which should be fixed in clearing directory build/projects/compiler-rt/test/profile/Profile-x86_64/Output/ on build machines.
@lei how can I do that ?

lei added a comment.Sep 24 2018, 9:38 AM

According to the logs, there is an issue in the # of Runs for each file which should be fixed in clearing directory build/projects/compiler-rt/test/profile/Profile-x86_64/Output/ on build machines.
@lei how can I do that ?

Didn't realize that was it... I'll take care of that then. Thx!