[PATCH] D34651: [Dominators] Use a custom DFS implementation

Jakub Kuderski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 26 15:41:25 PDT 2017


kuhar created this revision.

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) .


https://reviews.llvm.org/D34651

Files:
  include/llvm/Support/GenericDomTreeConstruction.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34651.104031.patch
Type: text/x-patch
Size: 9121 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170626/7d30090b/attachment.bin>


More information about the llvm-commits mailing list