diff options
author | Fangrui Song <maskray@google.com> | 2019-02-19 05:16:52 +0000 |
---|---|---|
committer | Fangrui Song <maskray@google.com> | 2019-02-19 05:16:52 +0000 |
commit | b7fbfa68779a3f96c6cc933aba3cafb91f3a37ef (patch) | |
tree | 632767bc28430f39f58abb11da2d4597e90a7cba /lldb/packages/Python/lldbsuite/test | |
parent | c81e0c67ba554fbb8d446e025a7039c0ef11dd92 (diff) | |
download | bcm5719-llvm-b7fbfa68779a3f96c6cc933aba3cafb91f3a37ef.tar.gz bcm5719-llvm-b7fbfa68779a3f96c6cc933aba3cafb91f3a37ef.zip |
[Dominators] Fix and optimize edge insertion of depth-based search
Summary:
After (x,y) is inserted, depth-based search finds all affected v that satisfies:
depth(nca(x,y))+1 < depth(v) && there exists a path P from y to v where every w on P satisfies depth(v) <= depth(w)
This reduces to a widest path problem (maximizing the depth of the
minimum vertex in the path) which can be solved by a modified version of
Dijkstra with a bucket queue (named depth-based search in the paper).
The algorithm visits vertices in decreasing order of bucket number.
However, the current code misused priority_queue to extract them in
increasing order. I cannot think of a failing scenario but it surely may
process vertices more than once due to the local usage of Processed.
This patch fixes this bug and simplifies/optimizes the code a bit. Also
add more comments.
Reviewers: kuhar
Reviewed By: kuhar
Subscribers: kristina, jdoerfert, llvm-commits, NutshellySima, brzycki
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D58349
llvm-svn: 354306
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
0 files changed, 0 insertions, 0 deletions