[Dominators] Use a custom DFS implementation
Summary: Custom DFS implementation allows us to skip over certain nodes without adding them to the visited map, which is not easily doable with llvm's dfs iterators. What's more, caching predecessors becomes easy. This patch implements a single DFS function (template) for both forward and reverse DFS, which should be easier to maintain then separate two ones. Skipping over nodes based on a predicate will be necessary later to implement incremental updates. There also seems to be a very slight performance improved when bootstrapping clang with this patch on my machine (3:28s -> 3:26s) . Reviewers: dberlin, sanjoy, davide, grosser Reviewed By: dberlin Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D34651 llvm-svn: 307727
Loading
Please sign in to comment