[PATCH] D29381: [PM/LCG] Remove the lazy RefSCC formation from the LazyCallGraph during iteration.

Davide Italiano via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 5 11:57:06 PST 2017

davide added inline comments.

Comment at: lib/Analysis/LazyCallGraph.cpp:1690
           // node onto the stack.
           DFSStack.push_back({N, I});
dberlin wrote:
> Just to note, you don't actually have to push the stack here.
> This will push every node onto the stack.
> it's possible to push only the root nodes onto the stack.
> This is more memory efficient, and about 25% faster.
> This is  nuutila's variant, which is easy to implement:
> http://www.cse.tkk.fi/~enu/ps/ipl-scc.ps
> or
> http://www.cse.tkk.fi/~enu/ps/tko-b94-scc.ps
> or 
> the tarjan scc part of https://reviews.llvm.org/D28934
> (For the papers, you want algorithm 1, not 2)
My understanding of Nuutila is that it's faster if the graph is sparse, and when I spoke and proposed this to Chandler he mentioned the graph maybe not-that-sparse (for some definition of). I never found the SCC computation being a bottleneck (even for large programs), but I like Nuutila's variant so I wouldn't be opposed to that (and I think it's worth a try)


More information about the llvm-commits mailing list