[PATCH] D36442: [DomTree] Use a non-recursive DFS instead of a recursive one; NFC

Jakub Kuderski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 8 00:04:35 PDT 2017


kuhar accepted this revision.
kuhar added a comment.
This revision is now accepted and ready to land.

LGTM.

Out of curiosity: what kind of IR triggers stack overflow here? I'd suspect it would be have to a very large and nested loop.



================
Comment at: include/llvm/Support/GenericDomTreeConstruction.h:437
+    SmallVector<TreeNodePtr, 8> Stack;
+    Stack.push_back(TN);
+    assert(TN->getBlock() && II.Visited.count(TN) && "Preconditions!");
----------------
Nitpick: in other places in the file, stack are initialized like this:
`SmallVector<Ptr, 8> Stack = {FirstElem};`


https://reviews.llvm.org/D36442





More information about the llvm-commits mailing list