[PATCH] D75024: [SCCIterator] Check if a SCC is a natural loop.

Michael Kruse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 23 12:29:24 PST 2020


Meinersbur added a comment.

In D75024#1888383 <https://reviews.llvm.org/D75024#1888383>, @baziotis wrote:

> Hmm, that's bizarre. Won't the SCCIterator go through all the SCCs? That is, let's say we have a topmost loop with blocks: A, B, C. And blocks B, C also form a loop.
>  Won't we get a separate SCC for A, B, C and B, C?


It uses Tarjan's algorithm <https://en.wikipedia.org/wiki/Tarjan%27s_strongly_connected_components_algorithm> which only returns maximal connected subgraphs. Anything else would be infeasible. Think of a complete graph, every subset of nodes would by strongly connected (but not maximal), hence return an exponential number of strongly connected subgraphs. Only the entire complete graph is maximal and considered a component.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75024/new/

https://reviews.llvm.org/D75024





More information about the llvm-commits mailing list