[PATCH] D40987: Rewrite the cached map used for locating the most precise DIE among inlined subroutines for a given address.

Paul Robinson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 26 09:06:25 PST 2017


probinson added a comment.

Sorry, missed this somehow...  I didn't really look at the second layer, but I have a suggestion for the initial tree walk.



================
Comment at: llvm/trunk/lib/DebugInfo/DWARF/DWARFUnit.cpp:380
+    for (DWARFDie Child : Die.children())
+      Worklist.push_back(Child);
+
----------------
Would the overall algorithm be faster if it adds the child to the worklist only if the child itself is a subprogram, or has children?  Currently this loop adds uninteresting leaf DIEs to the worklist, only to discover they are uninteresting on a later iteration.  I'd think keeping the size of the worklist down could be beneficial.

There are DIEs that can have children but do not represent scopes (array_type and enum_type come to mind) or otherwise cannot have subprogram children, and it would be possible to come up with a list of those.  But checking for a long list of tag types might get too expensive.  With my above suggestion, you still (for example) add enum_type to the worklist, but not the individual enumerator DIEs, and that gets you the bulk of the performance benefit.


Repository:
  rL LLVM

https://reviews.llvm.org/D40987





More information about the llvm-commits mailing list