LLVM loops cannot represent irreducible structures in the CFG. This
change introduce the concept of cycles as a generalization loops,
along with a CycleInfo analysis that discover a nested
hierarchy of such cycles. This is based on Havlak (1997), Nesting of
Reducible and Irreducible Loops.
The cycle analysis is implemented as a generic template and then
instatiated for LLVM IR and Machine IR. The template relies on a new
GenericSsaContext template which must be specialized when used for
each IR.
This review is a restart of an older review request:
https://reviews.llvm.org/D83094
Original implementation by Nicolai Hähnle <nicolai.haehnle@amd.com>,
with recent refactoring by Sameer Sahasrabuddhe <sameer.sahasrabuddhe@amd.com>
Why do we need this root cycle? All the blocks of a function mostly do not even form a strongly connected region. And this is quite different from the way LoopInfo works.