[PATCH] D69027: [llvm-dwarfdump][Statistics] Fix calculation of OffsetToFirstDefinition
Alexey Lapshin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 1 05:02:50 PDT 2019
avl added a comment.
> if you want a % one, "bytes covered by location lists" / "bytes of enclosing scopes" (counting each scope once for each variable within it - or doing the loc-list-intersects-with-enclosing-scope earlier & just tracking the relative numbers from that point).
Probably, I misunderstood above. Correct me if I wrong, please:
"bytes covered by location lists" - includes all variables.
"bytes of enclosing scopes" - includes all scopes and each scope counted once for each variable within it.
correct ?
In that case, if we have one scope which has 10 variables with locations from start to end, then calculated percentage number would be 1000%.
"bytes covered by location lists" / "bytes of enclosing scopes" * 100 = 1000%
To have resulting percentage number inside 100% we need to count scope each time for each variable.
for each variable :
from start_scope_pc till end_scope_pc
ScopeBytes += scope_pc_range
ScopeBytesCovered += scope_pc_range INTERSECTION OF variable_loc_list_range
ScopeCoverage = ScopeBytesCovered / ScopeBytes * 100;
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D69027/new/
https://reviews.llvm.org/D69027
More information about the llvm-commits
mailing list