Using address range map to speedup finding inline stack for address.
authorDehao Chen <dehao@google.com>
Wed, 19 Apr 2017 20:09:38 +0000 (20:09 +0000)
committerDehao Chen <dehao@google.com>
Wed, 19 Apr 2017 20:09:38 +0000 (20:09 +0000)
commita364f09f185f65c3d23d93a313177ca8da3d7877
tree8dda0f2421d3f3db90830b7bda71d73391329c7d
parent6e2ec5f10ecca4db786cb5d2c3c4f1701a940385
Using address range map to speedup finding inline stack for address.

Summary:
In the current implementation, to find inline stack for an address incurs expensive linear search in 2 places:

* linear search for the top-level DIE
* recursive linear traverse the DIE tree to find the path to the leaf DIE

In this patch, a map is built from address to its corresponding leaf DIE. The inline stack is built by traversing from the leaf DIE up to the root DIE. This speeds up batch symbolization by ~10X without noticible memory overhead.

Reviewers: dblaikie

Reviewed By: dblaikie

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D32177

llvm-svn: 300742
llvm/include/llvm/DebugInfo/DWARF/DWARFDie.h
llvm/include/llvm/DebugInfo/DWARF/DWARFUnit.h
llvm/lib/DebugInfo/DWARF/DWARFDie.cpp
llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp
llvm/test/tools/llvm-symbolizer/padding-x86_64.ll [new file with mode: 0644]