[PATCH] D57849: llvm-dwarfdump: Stop counting out-of-line subprogram in the "inlined functions" statistic.
Caroline Tice via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 6 14:41:19 PST 2019
cmtice created this revision.
cmtice added a reviewer: aprantl.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
DW_TAG_subprogram DIEs should not be counted in the inlined function statistic. This also addresses the source variables count, as that uses the inlined function count in its calculations.
Repository:
rL LLVM
https://reviews.llvm.org/D57849
Files:
test/tools/llvm-dwarfdump/X86/statistics.ll
test/tools/llvm-dwarfdump/X86/stats-inlining-multi-cu.ll
test/tools/llvm-dwarfdump/X86/stats-inlining-single-cu.ll
tools/llvm-dwarfdump/Statistics.cpp
Index: tools/llvm-dwarfdump/Statistics.cpp
===================================================================
--- tools/llvm-dwarfdump/Statistics.cpp
+++ tools/llvm-dwarfdump/Statistics.cpp
@@ -175,7 +175,8 @@
return;
// We've seen an (inlined) instance of this function.
auto &FnStats = FnStatMap[Name];
- FnStats.NumFnInlined++;
+ if (IsInlinedFunction)
+ FnStats.NumFnInlined++;
FnStats.IsFunction = true;
}
Index: test/tools/llvm-dwarfdump/X86/stats-inlining-single-cu.ll
===================================================================
--- test/tools/llvm-dwarfdump/X86/stats-inlining-single-cu.ll
+++ test/tools/llvm-dwarfdump/X86/stats-inlining-single-cu.ll
@@ -5,9 +5,9 @@
; The results for both tests should be identical.
; CHECK: "source functions":4,
-; CHECK-SAME: "inlined functions":5,
+; CHECK-SAME: "inlined functions":2,
; CHECK-SAME: "unique source variables":4
-; CHECK-SAME: "source variables":6
+; CHECK-SAME: "source variables":4
; CHECK-SAME: "variables with location":6
;header.h:
Index: test/tools/llvm-dwarfdump/X86/stats-inlining-multi-cu.ll
===================================================================
--- test/tools/llvm-dwarfdump/X86/stats-inlining-multi-cu.ll
+++ test/tools/llvm-dwarfdump/X86/stats-inlining-multi-cu.ll
@@ -4,9 +4,9 @@
; Test that abstract origins in multiple CUs are uniqued.
; CHECK: "source functions":4,
-; CHECK-SAME: "inlined functions":5,
+; CHECK-SAME: "inlined functions":2,
; CHECK-SAME: "unique source variables":4
-; CHECK-SAME: "source variables":6
+; CHECK-SAME: "source variables":4
; CHECK-SAME: "variables with location":6
;header.h:
Index: test/tools/llvm-dwarfdump/X86/statistics.ll
===================================================================
--- test/tools/llvm-dwarfdump/X86/statistics.ll
+++ test/tools/llvm-dwarfdump/X86/statistics.ll
@@ -18,7 +18,7 @@
; GlobalConst,Global,s,s.constant,square::i,cube::i,cube::squared
; CHECK: "unique source variables":7
; +1 extra inline i.
-; CHECK: "source variables":8
+; CHECK: "source variables":5
; -1 square::i
; CHECK: "variables with location":7
; CHECK: "scope bytes total":[[BYTES:[0-9]+]]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57849.185641.patch
Type: text/x-patch
Size: 2216 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190206/df11c8c0/attachment.bin>
More information about the llvm-commits
mailing list