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.
Would llvm::IntervalMap be more suitable here? (or at least DenseMap, perhaps)