[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
This commit is contained in:
Chandler Carruth
2014-04-26 03:36:42 +00:00
parent 0c8f0bfce2
commit dec9a2ca23
2 changed files with 40 additions and 30 deletions

View File

@ -132,6 +132,8 @@ public:
: G(&G), NI(Nodes.end()) {}
public:
iterator() {}
bool operator==(const iterator &Arg) const { return NI == Arg.NI; }
bool operator!=(const iterator &Arg) const { return !operator==(Arg); }