LLVM 24.0.0git
GenericCycleInfo.h File Reference

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

#include "llvm/ADT/DenseMapInfo.h"
#include "llvm/ADT/GenericSSAContext.h"
#include "llvm/ADT/GraphTraits.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/Sequence.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/iterator.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include <memory>
#include <type_traits>

Go to the source code of this file.

Classes

class  llvm::CycleRef
 Opaque handle to a cycle within a GenericCycleInfo that wraps the cycle's preorder index. More...
struct  llvm::DenseMapInfo< CycleRef >
class  llvm::GenericCycleInfo< ContextT >
 Cycle information for a function. More...
struct  llvm::GenericCycleInfo< ContextT >::const_child_iterator
 Iteration over child cycles, yielding handles. More...

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.md 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.