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

A possibly irreducible generalization of a Loop. More...

#include "llvm/ADT/GenericCycleInfo.h"

Classes

struct  const_child_iterator
 

Public Types

using BlockT = typename ContextT::BlockT
 
using FunctionT = typename ContextT::FunctionT
 
using const_child_iterator_base = typename std::vector< std::unique_ptr< GenericCycle > >::const_iterator
 Iteration over child cycles. More...
 
using const_block_iterator = typename std::vector< BlockT * >::const_iterator
 Iteration over blocks in the cycle (including entry blocks). More...
 
using const_entry_iterator = typename SmallVectorImpl< BlockT * >::const_iterator
 Iteration over entry blocks. More...
 

Public Member Functions

 GenericCycle ()=default
 
bool isReducible () const
 Whether the cycle is a natural loop. More...
 
BlockTgetHeader () const
 
bool isEntry (BlockT *Block) const
 Return whether Block is an entry block of the cycle. More...
 
bool contains (const BlockT *Block) const
 Return whether Block is contained in the cycle. More...
 
bool contains (const GenericCycle *C) const
 Returns true iff this cycle contains C. More...
 
const GenericCyclegetParentCycle () const
 
GenericCyclegetParentCycle ()
 
unsigned getDepth () const
 
void getExitBlocks (SmallVectorImpl< BlockT * > &TmpStorage) const
 Return all of the successor blocks of this cycle. More...
 
const_child_iterator child_begin () const
 
const_child_iterator child_end () const
 
size_t getNumChildren () const
 
iterator_range< const_child_iteratorchildren () const
 
const_block_iterator block_begin () const
 
const_block_iterator block_end () const
 
size_t getNumBlocks () const
 
iterator_range< const_block_iteratorblocks () const
 
size_t getNumEntries () const
 
iterator_range< const_entry_iteratorentries () const
 
Printable printEntries (const ContextT &Ctx) const
 
Printable print (const ContextT &Ctx) const
 

Friends

template<typename >
class GenericCycleInfo
 
template<typename >
class GenericCycleInfoCompute
 

Detailed Description

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

A possibly irreducible generalization of a Loop.

Definition at line 48 of file GenericCycleInfo.h.

Member Typedef Documentation

◆ BlockT

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

Definition at line 50 of file GenericCycleInfo.h.

◆ const_block_iterator

template<typename ContextT >
using llvm::GenericCycle< ContextT >::const_block_iterator = typename std::vector<BlockT *>::const_iterator

Iteration over blocks in the cycle (including entry blocks).

Definition at line 158 of file GenericCycleInfo.h.

◆ const_child_iterator_base

template<typename ContextT >
using llvm::GenericCycle< ContextT >::const_child_iterator_base = typename std::vector<std::unique_ptr<GenericCycle> >::const_iterator

Iteration over child cycles.

Definition at line 130 of file GenericCycleInfo.h.

◆ const_entry_iterator

template<typename ContextT >
using llvm::GenericCycle< ContextT >::const_entry_iterator = typename SmallVectorImpl<BlockT *>::const_iterator

Iteration over entry blocks.

Definition at line 175 of file GenericCycleInfo.h.

◆ FunctionT

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

Definition at line 51 of file GenericCycleInfo.h.

Constructor & Destructor Documentation

◆ GenericCycle()

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

Member Function Documentation

◆ block_begin()

template<typename ContextT >
const_block_iterator llvm::GenericCycle< ContextT >::block_begin ( ) const
inline

Definition at line 160 of file GenericCycleInfo.h.

Referenced by llvm::GenericCycle< ContextT >::blocks().

◆ block_end()

template<typename ContextT >
const_block_iterator llvm::GenericCycle< ContextT >::block_end ( ) const
inline

Definition at line 163 of file GenericCycleInfo.h.

Referenced by llvm::GenericCycle< ContextT >::blocks().

◆ blocks()

template<typename ContextT >
iterator_range<const_block_iterator> llvm::GenericCycle< ContextT >::blocks ( ) const
inline

◆ child_begin()

template<typename ContextT >
const_child_iterator llvm::GenericCycle< ContextT >::child_begin ( ) const
inline

Definition at line 143 of file GenericCycleInfo.h.

◆ child_end()

template<typename ContextT >
const_child_iterator llvm::GenericCycle< ContextT >::child_end ( ) const
inline

Definition at line 146 of file GenericCycleInfo.h.

◆ children()

template<typename ContextT >
iterator_range<const_child_iterator> llvm::GenericCycle< ContextT >::children ( ) const
inline

Definition at line 150 of file GenericCycleInfo.h.

References llvm::make_range().

◆ contains() [1/2]

template<typename ContextT >
bool llvm::GenericCycle< ContextT >::contains ( const BlockT Block) const
inline

Return whether Block is contained in the cycle.

Definition at line 107 of file GenericCycleInfo.h.

References llvm::is_contained().

◆ contains() [2/2]

template<typename ContextT >
bool llvm::GenericCycle< ContextT >::contains ( const GenericCycle< ContextT > *  C) const

Returns true iff this cycle contains C.

Note: Non-strict containment check, i.e. returns true if C is the same cycle.

Definition at line 35 of file GenericCycleImpl.h.

References llvm::Depth.

◆ entries()

template<typename ContextT >
iterator_range<const_entry_iterator> llvm::GenericCycle< ContextT >::entries ( ) const
inline

Definition at line 178 of file GenericCycleInfo.h.

References llvm::make_range().

◆ getDepth()

template<typename ContextT >
unsigned llvm::GenericCycle< ContextT >::getDepth ( ) const
inline

Definition at line 119 of file GenericCycleInfo.h.

References llvm::Depth.

◆ getExitBlocks()

template<typename ContextT >
void llvm::GenericCycle< ContextT >::getExitBlocks ( SmallVectorImpl< BlockT * > &  TmpStorage) const

Return all of the successor blocks of this cycle.

These are the blocks outside of the current cycle which are branched to.

Definition at line 47 of file GenericCycleImpl.h.

References llvm::append_range(), llvm::SmallVectorImpl< T >::clear(), and llvm::successors().

◆ getHeader()

template<typename ContextT >
BlockT* llvm::GenericCycle< ContextT >::getHeader ( ) const
inline

Definition at line 101 of file GenericCycleInfo.h.

◆ getNumBlocks()

template<typename ContextT >
size_t llvm::GenericCycle< ContextT >::getNumBlocks ( ) const
inline

Definition at line 166 of file GenericCycleInfo.h.

◆ getNumChildren()

template<typename ContextT >
size_t llvm::GenericCycle< ContextT >::getNumChildren ( ) const
inline

Definition at line 149 of file GenericCycleInfo.h.

◆ getNumEntries()

template<typename ContextT >
size_t llvm::GenericCycle< ContextT >::getNumEntries ( ) const
inline

Definition at line 177 of file GenericCycleInfo.h.

◆ getParentCycle() [1/2]

template<typename ContextT >
GenericCycle* llvm::GenericCycle< ContextT >::getParentCycle ( )
inline

Definition at line 118 of file GenericCycleInfo.h.

◆ getParentCycle() [2/2]

template<typename ContextT >
const GenericCycle* llvm::GenericCycle< ContextT >::getParentCycle ( ) const
inline

Definition at line 117 of file GenericCycleInfo.h.

◆ isEntry()

template<typename ContextT >
bool llvm::GenericCycle< ContextT >::isEntry ( BlockT Block) const
inline

Return whether Block is an entry block of the cycle.

Definition at line 104 of file GenericCycleInfo.h.

References llvm::is_contained().

Referenced by llvm::GenericCycle< ContextT >::print().

◆ isReducible()

template<typename ContextT >
bool llvm::GenericCycle< ContextT >::isReducible ( ) const
inline

Whether the cycle is a natural loop.

Definition at line 99 of file GenericCycleInfo.h.

◆ print()

template<typename ContextT >
Printable llvm::GenericCycle< ContextT >::print ( const ContextT &  Ctx) const
inline

◆ printEntries()

template<typename ContextT >
Printable llvm::GenericCycle< ContextT >::printEntries ( const ContextT &  Ctx) const
inline

Definition at line 183 of file GenericCycleInfo.h.

References First.

Referenced by llvm::GenericCycle< ContextT >::print().

Friends And Related Function Documentation

◆ GenericCycleInfo

template<typename ContextT >
template<typename >
friend class GenericCycleInfo
friend

Definition at line 52 of file GenericCycleInfo.h.

◆ GenericCycleInfoCompute

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

Definition at line 53 of file GenericCycleInfo.h.


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