[PATCH] D69027: [llvm-dwarfdump][Statistics] Fix calculation of OffsetToFirstDefinition

Kristina Bessonova via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 21 03:58:40 PDT 2019


krisb added a comment.

@avl, thanks for the comment.

In D69027#1714203 <https://reviews.llvm.org/D69027#1714203>, @avl wrote:

> I think OffsetToFirstDefinition should not be taken into account at all.
>  i.e., coverage should be calculated against block scope, not against variable scope(which is unknown).


Despite, we are not able to precisely identify where a variable starts, I still think that the heuristic we use is valuable. It makes a good sense to assume that in non-optimized code the 'first definition' in debug info comes close to the start of the variable's scope. 
Furthermore, if to give up guessing about the variable's scope, we should also avoid calculating 'coverage'. I mean the value of range covered with debug info divided by the size of scope doesn't have a clear 'physical' meaning, IMO.

In D69027#1714203 <https://reviews.llvm.org/D69027#1714203>, @avl wrote:

> That hides original low coverage for that variable and makes invisible performed improvement.


This will be shown in "vars scope bytes total" and "vars scope bytes covered" statistics.


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