[PATCH] D100068: [llvm-dwarfdump] Fix slowdown in dwarfdump statistics.
Rumeet Dhindsa via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 7 14:01:16 PDT 2021
rdhindsa created this revision.
rdhindsa added a reviewer: djtodoro.
Herald added a reviewer: jhenderson.
Herald added a subscriber: cmtice.
rdhindsa requested review of this revision.
Herald added subscribers: llvm-commits, MaskRay.
Herald added a project: LLVM.
Fixed slowdown that happened after https://reviews.llvm.org/D96045,
While running dwarfdump --statistics, it spends more than 50% of the time in collectZeroCovInlinedVars function.
In function collectStatsForObjectFile, variable InlinedFnsToBeProcessed is being created outside the for loop. The inline functions to be processed are appended and processed multiple times. Hence, moving the creation of that variable into the for loop which fixes the slowdown.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D100068
Files:
llvm/tools/llvm-dwarfdump/Statistics.cpp
Index: llvm/tools/llvm-dwarfdump/Statistics.cpp
===================================================================
--- llvm/tools/llvm-dwarfdump/Statistics.cpp
+++ llvm/tools/llvm-dwarfdump/Statistics.cpp
@@ -715,10 +715,10 @@
GlobalStats GlobalStats;
LocationStats LocStats;
InlinedVarsTyMap GlobalInlinedFnInfo;
- InlinedFnInstacesTy InlinedFnsToBeProcessed;
StringMap<PerFunctionStats> Statistics;
for (const auto &CU : static_cast<DWARFContext *>(&DICtx)->compile_units()) {
if (DWARFDie CUDie = CU->getNonSkeletonUnitDIE(false)) {
+ InlinedFnInstacesTy InlinedFnsToBeProcessed;
collectStatsRecursive(CUDie, "/", "g", 0, 0, Statistics, GlobalStats,
LocStats, GlobalInlinedFnInfo,
InlinedFnsToBeProcessed);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D100068.335920.patch
Type: text/x-patch
Size: 802 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210407/52da93b5/attachment.bin>
More information about the llvm-commits
mailing list