[PATCH] D25506: [LCG] Add utilities to compute parent and ascestor relationships between SCCs.

Chandler Carruth via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 21 23:29:11 PST 2016


chandlerc added inline comments.


================
Comment at: lib/Analysis/LazyCallGraph.cpp:212
+  SmallPtrSet<Node *, 16> Visited(Nodes.begin(), Nodes.end());
+  SmallVector<Node *, 16> Worklist(Nodes.begin(), Nodes.end());
+
----------------
sanjoy wrote:
> Why not walk over `SCC` instances directly?  The way you've written these, I think you'll spend time "re-discovering" the SCC structures (that is walking intra-SCC call edges) when that is avoidable.
Good idea. I was thinking that it wouldn't be any better to do this because we have to walk the nodes anyways, but you're totally right this is much more efficient if it collapses immediately to SCCs. Please have a look and make sure this matches what you expected.


https://reviews.llvm.org/D25506





More information about the llvm-commits mailing list