LLVM 22.0.0git
GenericCycleInfo.h File Reference

Find all cycles in a control-flow graph, including irreducible loops. More...

Go to the source code of this file.

Classes

class  llvm::GenericCycle< ContextT >
 A possibly irreducible generalization of a Loop. More...
struct  llvm::GenericCycle< ContextT >::const_child_iterator
class  llvm::GenericCycleInfo< ContextT >
 Cycle information for a function. More...
struct  llvm::GenericCycleInfo< ContextT >::const_toplevel_iterator
struct  llvm::CycleGraphTraits< CycleRefT, ChildIteratorT >
 GraphTraits for iterating over a sub-tree of the CycleT tree. More...
struct  llvm::GraphTraits< const GenericCycle< BlockT > * >
struct  llvm::GraphTraits< GenericCycle< BlockT > * >

Namespaces

namespace  llvm
 This is an optimization pass for GlobalISel generic memory operations.

Detailed Description

Find all cycles in a control-flow graph, including irreducible loops.

See docs/CycleTerminology.rst for a formal definition of cycles.

Briefly:

  • A cycle is a generalization of a loop which can represent irreducible control flow.
  • Cycles identified in a program are implementation defined, depending on the DFS traversal chosen.
  • Cycles are well-nested, and form a forest with a parent-child relationship.
  • In any choice of DFS, every natural loop L is represented by a unique cycle C which is a superset of L.
  • In the absence of irreducible control flow, the cycles are exactly the natural loops in the program.

Definition in file GenericCycleInfo.h.