[PATCH] D35851: [Dominators] Include infinite loops in PostDominatorTree

Daniel Berlin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 27 08:07:01 PDT 2017


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

I'm going to accept this.
But please give Tobias until early next week to comment, given his past concerns.
(IMHO, if he wants to suggest we do something different, at this point, I believe the onus is on him to implement such a thing and show it works)



================
Comment at: include/llvm/Support/GenericDomTreeConstruction.h:401
+    // Step #3: If we found some non-trivial roots, make them non-redundant.
+    if (HasNonTrivialRoots) RemoveRedundantRoots(DT, Roots);
+
----------------
kuhar wrote:
> dberlin wrote:
> > Can't you use the forward dfs in/outnumbers  to tell if the roots were redundant?
> > 
> > A redundant root should be within the in/out of some other root, no?
> > 
> It can happen that a path from a redundant root to some other one goes through reverse-reachable regions, so I think that would mean that we'd have to run the forward DFS on the whole CFG, including the forward-unreachable parts. Then, can you always tell if a node is a part of the same SCC as some other one using only DFS in/out numbers?
We could get away with running forward DFS only on the reverse-unreachable parts i believe.
But i think what you have is fine for now.




https://reviews.llvm.org/D35851





More information about the llvm-commits mailing list