LLVM 19.0.0git
Classes | Public Types | Public Member Functions | Friends | List of all members
llvm::GenericCycleInfo< ContextT > Class Template Reference

Cycle information for a function. More...

#include "llvm/ADT/GenericCycleInfo.h"

Inheritance diagram for llvm::GenericCycleInfo< ContextT >:
Inheritance graph
[legend]

Classes

struct  const_toplevel_iterator
 

Public Types

using BlockT = typename ContextT::BlockT
 
using CycleT = GenericCycle< ContextT >
 
using FunctionT = typename ContextT::FunctionT
 
using const_toplevel_iterator_base = typename std::vector< std::unique_ptr< CycleT > >::const_iterator
 Iteration over top-level cycles.
 

Public Member Functions

 GenericCycleInfo ()=default
 
 GenericCycleInfo (GenericCycleInfo &&)=default
 
GenericCycleInfooperator= (GenericCycleInfo &&)=default
 
void clear ()
 Reset the object to its initial state.
 
void compute (FunctionT &F)
 Compute the cycle info for a function.
 
void splitCriticalEdge (BlockT *Pred, BlockT *Succ, BlockT *New)
 
const FunctionTgetFunction () const
 
const ContextT & getSSAContext () const
 
CycleTgetCycle (const BlockT *Block) const
 Find the innermost cycle containing a given block.
 
CycleTgetSmallestCommonCycle (CycleT *A, CycleT *B) const
 Find the innermost cycle containing both given cycles.
 
unsigned getCycleDepth (const BlockT *Block) const
 get the depth for the cycle which containing a given block.
 
CycleTgetTopLevelParentCycle (BlockT *Block)
 
bool validateTree () const
 Methods for debug and self-test.
 
void print (raw_ostream &Out) const
 Print the cycle info.
 
void dump () const
 
Printable print (const CycleT *Cycle)
 
const_toplevel_iterator toplevel_begin () const
 
const_toplevel_iterator toplevel_end () const
 
iterator_range< const_toplevel_iteratortoplevel_cycles () const
 

Friends

template<typename >
class GenericCycle
 
template<typename >
class GenericCycleInfoCompute
 

Detailed Description

template<typename ContextT>
class llvm::GenericCycleInfo< ContextT >

Cycle information for a function.

Definition at line 222 of file GenericCycleInfo.h.

Member Typedef Documentation

◆ BlockT

template<typename ContextT >
using llvm::GenericCycleInfo< ContextT >::BlockT = typename ContextT::BlockT

Definition at line 224 of file GenericCycleInfo.h.

◆ const_toplevel_iterator_base

template<typename ContextT >
using llvm::GenericCycleInfo< ContextT >::const_toplevel_iterator_base = typename std::vector<std::unique_ptr<CycleT> >::const_iterator

Iteration over top-level cycles.

Definition at line 286 of file GenericCycleInfo.h.

◆ CycleT

template<typename ContextT >
using llvm::GenericCycleInfo< ContextT >::CycleT = GenericCycle<ContextT>

Definition at line 225 of file GenericCycleInfo.h.

◆ FunctionT

template<typename ContextT >
using llvm::GenericCycleInfo< ContextT >::FunctionT = typename ContextT::FunctionT

Definition at line 226 of file GenericCycleInfo.h.

Constructor & Destructor Documentation

◆ GenericCycleInfo() [1/2]

template<typename ContextT >
llvm::GenericCycleInfo< ContextT >::GenericCycleInfo ( )
default

◆ GenericCycleInfo() [2/2]

template<typename ContextT >
llvm::GenericCycleInfo< ContextT >::GenericCycleInfo ( GenericCycleInfo< ContextT > &&  )
default

Member Function Documentation

◆ clear()

template<typename ContextT >
void llvm::GenericCycleInfo< ContextT >::clear

◆ compute()

template<typename ContextT >
void llvm::GenericCycleInfo< ContextT >::compute ( FunctionT F)

◆ dump()

template<typename ContextT >
void llvm::GenericCycleInfo< ContextT >::dump ( ) const
inline

◆ getCycle()

template<typename ContextT >
auto llvm::GenericCycleInfo< ContextT >::getCycle ( const BlockT Block) const

Find the innermost cycle containing a given block.

Returns
the innermost cycle containing Block or nullptr if it is not contained in any cycle.

Definition at line 402 of file GenericCycleImpl.h.

References llvm::Block.

Referenced by llvm::SIInstrInfo::isSafeToSink(), and mayBeInCycle().

◆ getCycleDepth()

template<typename ContextT >
unsigned llvm::GenericCycleInfo< ContextT >::getCycleDepth ( const BlockT Block) const

get the depth for the cycle which containing a given block.

Returns
the depth for the innermost cycle containing Block or 0 if it is not contained in any cycle.

Definition at line 441 of file GenericCycleImpl.h.

References llvm::Block, and llvm::GenericCycle< ContextT >::getDepth().

◆ getFunction()

template<typename ContextT >
const FunctionT * llvm::GenericCycleInfo< ContextT >::getFunction ( ) const
inline

Definition at line 266 of file GenericCycleInfo.h.

References Context.

◆ getSmallestCommonCycle()

template<typename ContextT >
auto llvm::GenericCycleInfo< ContextT >::getSmallestCommonCycle ( CycleT A,
CycleT B 
) const

Find the innermost cycle containing both given cycles.

Returns
the innermost cycle containing both A and B or nullptr if there is no such cycle.

Definition at line 412 of file GenericCycleImpl.h.

References A, and B.

◆ getSSAContext()

template<typename ContextT >
const ContextT & llvm::GenericCycleInfo< ContextT >::getSSAContext ( ) const
inline

Definition at line 267 of file GenericCycleInfo.h.

References Context.

◆ getTopLevelParentCycle()

template<typename ContextT >
auto llvm::GenericCycleInfo< ContextT >::getTopLevelParentCycle ( BlockT Block)

Definition at line 147 of file GenericCycleImpl.h.

References llvm::Block, and llvm::CallingConv::C.

◆ operator=()

template<typename ContextT >
GenericCycleInfo & llvm::GenericCycleInfo< ContextT >::operator= ( GenericCycleInfo< ContextT > &&  )
default

◆ print() [1/2]

template<typename ContextT >
Printable llvm::GenericCycleInfo< ContextT >::print ( const CycleT Cycle)
inline

Definition at line 281 of file GenericCycleInfo.h.

References Context, and llvm::GenericCycle< ContextT >::print().

◆ print() [2/2]

template<typename ContextT >
void llvm::GenericCycleInfo< ContextT >::print ( raw_ostream Out) const

◆ splitCriticalEdge()

template<typename ContextT >
void llvm::GenericCycleInfo< ContextT >::splitCriticalEdge ( BlockT Pred,
BlockT Succ,
BlockT New 
)

Definition at line 385 of file GenericCycleImpl.h.

References assert().

◆ toplevel_begin()

template<typename ContextT >
const_toplevel_iterator llvm::GenericCycleInfo< ContextT >::toplevel_begin ( ) const
inline

Definition at line 302 of file GenericCycleInfo.h.

◆ toplevel_cycles()

template<typename ContextT >
iterator_range< const_toplevel_iterator > llvm::GenericCycleInfo< ContextT >::toplevel_cycles ( ) const
inline

Definition at line 309 of file GenericCycleInfo.h.

References llvm::make_range().

◆ toplevel_end()

template<typename ContextT >
const_toplevel_iterator llvm::GenericCycleInfo< ContextT >::toplevel_end ( ) const
inline

Definition at line 305 of file GenericCycleInfo.h.

◆ validateTree()

template<typename ContextT >
bool llvm::GenericCycleInfo< ContextT >::validateTree

Methods for debug and self-test.

Validate the internal consistency of the cycle tree.

Note that this does not check that cycles are really cycles in the CFG, or that the right set of cycles in the CFG were found.

Definition at line 454 of file GenericCycleImpl.h.

References llvm::Block, Blocks, check, llvm::GenericCycle< ContextT >::children(), Cond, llvm::GenericCycle< ContextT >::contains(), llvm::depth_first(), llvm::SmallVectorBase< Size_T >::empty(), llvm::errs(), llvm::is_contained(), and reportError().

Friends And Related Function Documentation

◆ GenericCycle

template<typename ContextT >
template<typename >
friend class GenericCycle
friend

Definition at line 227 of file GenericCycleInfo.h.

◆ GenericCycleInfoCompute

template<typename ContextT >
template<typename >
friend class GenericCycleInfoCompute
friend

Definition at line 228 of file GenericCycleInfo.h.


The documentation for this class was generated from the following files: