|
LLVM 23.0.0git
|
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 |
| Iteration over child cycles. | |
| using | const_block_iterator = typename BlockSetVectorT::const_iterator |
| Iteration over blocks in the cycle (including entry blocks). | |
| using | const_entry_iterator |
| Iteration over entry blocks. | |
| using | const_reverse_entry_iterator |
Friends | |
| template<typename> | |
| class | GenericCycleInfo |
| template<typename> | |
| class | GenericCycleInfoCompute |
A possibly irreducible generalization of a Loop.
Definition at line 45 of file GenericCycleInfo.h.
| using llvm::GenericCycle< ContextT >::BlockT = typename ContextT::BlockT |
Definition at line 47 of file GenericCycleInfo.h.
| using llvm::GenericCycle< ContextT >::const_block_iterator = typename BlockSetVectorT::const_iterator |
Iteration over blocks in the cycle (including entry blocks).
Definition at line 202 of file GenericCycleInfo.h.
| using llvm::GenericCycle< ContextT >::const_child_iterator_base |
Iteration over child cycles.
Definition at line 173 of file GenericCycleInfo.h.
| using llvm::GenericCycle< ContextT >::const_entry_iterator |
Iteration over entry blocks.
Definition at line 218 of file GenericCycleInfo.h.
| using llvm::GenericCycle< ContextT >::const_reverse_entry_iterator |
Definition at line 226 of file GenericCycleInfo.h.
| using llvm::GenericCycle< ContextT >::FunctionT = typename ContextT::FunctionT |
Definition at line 48 of file GenericCycleInfo.h.
|
default |
|
inline |
Definition at line 204 of file GenericCycleInfo.h.
Referenced by blocks().
|
inline |
Definition at line 207 of file GenericCycleInfo.h.
Referenced by blocks().
|
inline |
Definition at line 211 of file GenericCycleInfo.h.
References block_begin(), block_end(), and llvm::make_range().
|
inline |
Definition at line 187 of file GenericCycleInfo.h.
|
inline |
Definition at line 190 of file GenericCycleInfo.h.
|
inline |
Definition at line 194 of file GenericCycleInfo.h.
References llvm::make_range().
|
inline |
Clear the cache of the cycle.
This should be run in all non-const function in GenericCycle and GenericCycleInfo.
Definition at line 120 of file GenericCycleInfo.h.
Referenced by setSingleEntry().
|
inline |
Return whether Block is contained in the cycle.
Definition at line 136 of file GenericCycleInfo.h.
References llvm::Block.
Referenced by llvm::SIInstrInfo::isSafeToSink(), and setSingleEntry().
| 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 36 of file GenericCycleImpl.h.
References llvm::CallingConv::C, and llvm::Depth.
|
inline |
Definition at line 223 of file GenericCycleInfo.h.
References entry_begin(), entry_end(), and llvm::make_range().
Referenced by verifyCycle().
|
inline |
Definition at line 220 of file GenericCycleInfo.h.
Referenced by entries().
|
inline |
Definition at line 221 of file GenericCycleInfo.h.
Referenced by entries().
|
inline |
Definition at line 228 of file GenericCycleInfo.h.
|
inline |
Definition at line 229 of file GenericCycleInfo.h.
| auto llvm::GenericCycle< ContextT >::getCyclePredecessor | ( | ) | const |
If the cycle has exactly one entry with exactly one predecessor, return it, otherwise return nullptr.
Definition at line 110 of file GenericCycleImpl.h.
References const, contains(), getHeader(), isReducible(), and llvm::predecessors().
Referenced by getCyclePreheader().
| auto llvm::GenericCycle< ContextT >::getCyclePreheader | ( | ) | const |
Return the preheader block for this cycle.
Pre-header is well-defined for reducible cycle in docs/LoopTerminology.rst as: the only one entering block and its only edge is to the entry block. Return null for irreducible cycles.
Definition at line 92 of file GenericCycleImpl.h.
References assert(), const, getCyclePredecessor(), isReducible(), and llvm::succ_size().
|
inline |
Definition at line 146 of file GenericCycleInfo.h.
|
inline |
Definition at line 113 of file GenericCycleInfo.h.
| 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 48 of file GenericCycleImpl.h.
References llvm::append_range(), llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::Block, blocks, llvm::SmallVectorImpl< T >::clear(), contains(), llvm::SmallVectorTemplateCommon< T, typename >::end(), llvm::SmallVectorImpl< T >::resize(), llvm::SmallVectorTemplateCommon< T, typename >::size(), and llvm::successors().
Referenced by verifyCycle().
| void llvm::GenericCycle< ContextT >::getExitingBlocks | ( | SmallVectorImpl< BlockT * > & | TmpStorage | ) | const |
Return all blocks of this cycle that have successor outside of this cycle.
These blocks have cycle exit branch.
Definition at line 77 of file GenericCycleImpl.h.
References llvm::Block, blocks, llvm::SmallVectorImpl< T >::clear(), contains(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::successors().
Referenced by llvm::SIInstrInfo::isSafeToSink().
|
inline |
Definition at line 111 of file GenericCycleInfo.h.
Referenced by getCyclePredecessor(), and verifyCycle().
|
inline |
Definition at line 210 of file GenericCycleInfo.h.
Referenced by verifyCycle().
|
inline |
Definition at line 193 of file GenericCycleInfo.h.
|
inline |
Definition at line 222 of file GenericCycleInfo.h.
|
inline |
Definition at line 145 of file GenericCycleInfo.h.
|
inline |
Definition at line 144 of file GenericCycleInfo.h.
Referenced by llvm::SIInstrInfo::isSafeToSink().
|
inline |
Return whether Block is an entry block of the cycle.
Definition at line 123 of file GenericCycleInfo.h.
References llvm::Block, and llvm::is_contained().
Referenced by print().
|
inline |
Whether the cycle is a natural loop.
Definition at line 109 of file GenericCycleInfo.h.
Referenced by getCyclePredecessor(), and getCyclePreheader().
|
inline |
Definition at line 240 of file GenericCycleInfo.h.
References llvm::Block, isEntry(), and printEntries().
|
inline |
Definition at line 232 of file GenericCycleInfo.h.
Referenced by print().
|
inline |
Replace all entries with Block as single entry.
Definition at line 128 of file GenericCycleInfo.h.
References assert(), llvm::Block, clearCache(), and contains().
| void llvm::GenericCycle< ContextT >::verifyCycle | ( | ) | const |
Verify that this is actually a well-formed cycle in the CFG.
Definition at line 130 of file GenericCycleImpl.h.
References llvm::any_of(), assert(), B(), llvm::SmallVectorTemplateCommon< T, typename >::begin(), blocks, llvm::children(), contains(), llvm::SmallPtrSetImpl< PtrType >::count(), llvm::dbgs(), llvm::depth_first(), llvm::depth_first_ext(), llvm::SmallVectorTemplateCommon< T, typename >::end(), entries(), getExitBlocks(), getHeader(), getNumBlocks(), getParent(), llvm::detail::DenseSetImpl< ValueT, MapTy, ValueInfoT >::insert(), llvm::df_iterator_default_set< NodeRef, SmallSize >::insert(), llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::inverse_children(), llvm_unreachable, llvm::SmallPtrSetImplBase::size(), and verifyCycleNest().
| void llvm::GenericCycle< ContextT >::verifyCycleNest | ( | ) | const |
Verify the parent-child relations of this cycle.
Note that this does not check that cycle is really a cycle in the CFG.
Definition at line 207 of file GenericCycleImpl.h.
References assert(), llvm::children(), contains(), and llvm::is_contained().
Referenced by verifyCycle().
Definition at line 49 of file GenericCycleInfo.h.
References GenericCycleInfo.
Referenced by GenericCycleInfo.
Definition at line 50 of file GenericCycleInfo.h.
References GenericCycleInfoCompute.
Referenced by GenericCycleInfoCompute.