[LCG] In the incremental SCC re-formation, lift the node currently being
authorChandler Carruth <chandlerc@gmail.com>
Sat, 26 Apr 2014 03:36:42 +0000 (03:36 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Sat, 26 Apr 2014 03:36:42 +0000 (03:36 +0000)
commitdec9a2ca23b115247170bc439983f7dd55757b61
treefb658017ada1f94ba40ed711e68bc882316c2381
parent0c8f0bfce2edbd1f22604c5243b7ae016067a2ad
[LCG] In the incremental SCC re-formation, lift the node currently being
processed in the DFS out of the stack completely. Keep it exclusively in
a variable. Re-shuffle some code structure to make this easier. This can
have a very dramatic effect in some cases because call graphs tend to
look like a high fan-out spanning tree. As a consequence, there are
a large number of leaf nodes in the graph, and this technique causes
leaf nodes to never even go into the stack. While this only reduces the
max depth by 1, it may cause the total number of round trips through the
stack to drop by a lot.

Now, most of this isn't really relevant for the incremental version. =]
But I wanted to prototype it first here as this variant is in ways more
complex. As long as I can get the code factored well here, I'll next
make the primary walk look the same. There are several refactorings this
exposes I think.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207306 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Analysis/LazyCallGraph.h
lib/Analysis/LazyCallGraph.cpp