LLVM 20.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 = typename std::vector< std::unique_ptr< GenericCycle > >::const_iterator |
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 = typename SmallVectorImpl< BlockT * >::const_iterator |
Iteration over entry blocks. | |
using | const_reverse_entry_iterator = typename SmallVectorImpl< BlockT * >::const_reverse_iterator |
Friends | |
template<typename > | |
class | GenericCycleInfo |
template<typename > | |
class | GenericCycleInfoCompute |
A possibly irreducible generalization of a Loop.
Definition at line 44 of file GenericCycleInfo.h.
using llvm::GenericCycle< ContextT >::BlockT = typename ContextT::BlockT |
Definition at line 46 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 201 of file GenericCycleInfo.h.
using llvm::GenericCycle< ContextT >::const_child_iterator_base = typename std::vector<std::unique_ptr<GenericCycle> >::const_iterator |
Iteration over child cycles.
Definition at line 172 of file GenericCycleInfo.h.
using llvm::GenericCycle< ContextT >::const_entry_iterator = typename SmallVectorImpl<BlockT *>::const_iterator |
Iteration over entry blocks.
Definition at line 217 of file GenericCycleInfo.h.
using llvm::GenericCycle< ContextT >::const_reverse_entry_iterator = typename SmallVectorImpl<BlockT *>::const_reverse_iterator |
Definition at line 225 of file GenericCycleInfo.h.
using llvm::GenericCycle< ContextT >::FunctionT = typename ContextT::FunctionT |
Definition at line 47 of file GenericCycleInfo.h.
|
default |
|
inline |
Definition at line 203 of file GenericCycleInfo.h.
References Blocks.
Referenced by llvm::GenericCycle< ContextT >::blocks().
|
inline |
Definition at line 206 of file GenericCycleInfo.h.
References Blocks.
Referenced by llvm::GenericCycle< ContextT >::blocks().
|
inline |
Definition at line 210 of file GenericCycleInfo.h.
References llvm::GenericCycle< ContextT >::block_begin(), llvm::GenericCycle< ContextT >::block_end(), and llvm::make_range().
Referenced by llvm::GenericCycleInfo< ContextT >::verifyCycleNest().
|
inline |
Definition at line 186 of file GenericCycleInfo.h.
|
inline |
Definition at line 189 of file GenericCycleInfo.h.
|
inline |
Definition at line 193 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 119 of file GenericCycleInfo.h.
References llvm::SmallVectorImpl< T >::clear().
Referenced by llvm::GenericCycle< ContextT >::setSingleEntry().
|
inline |
Return whether Block
is contained in the cycle.
Definition at line 135 of file GenericCycleInfo.h.
References llvm::Block, and Blocks.
Referenced by llvm::getExtDivCycle(), llvm::getIntDivCycle(), llvm::isCycleInvariant(), llvm::SIInstrInfo::isSafeToSink(), llvm::GenericCycle< ContextT >::setSingleEntry(), and llvm::GenericCycleInfo< ContextT >::verifyCycleNest().
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 222 of file GenericCycleInfo.h.
References llvm::GenericCycle< ContextT >::entry_begin(), llvm::GenericCycle< ContextT >::entry_end(), and llvm::make_range().
|
inline |
Definition at line 219 of file GenericCycleInfo.h.
Referenced by llvm::GenericCycle< ContextT >::entries().
|
inline |
Definition at line 220 of file GenericCycleInfo.h.
Referenced by llvm::GenericCycle< ContextT >::entries().
|
inline |
Definition at line 227 of file GenericCycleInfo.h.
|
inline |
Definition at line 228 of file GenericCycleInfo.h.
auto llvm::GenericCycle< ContextT >::getCyclePredecessor |
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 contains(), and llvm::predecessors().
auto llvm::GenericCycle< ContextT >::getCyclePreheader |
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(), and llvm::succ_size().
|
inline |
Definition at line 145 of file GenericCycleInfo.h.
References llvm::Depth.
Referenced by llvm::GenericCycleInfo< ContextT >::getCycleDepth().
|
inline |
Definition at line 112 of file GenericCycleInfo.h.
Referenced by llvm::isCycleInvariant().
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(), End, Idx, llvm::SmallVectorImpl< T >::resize(), llvm::SmallVectorBase< Size_T >::size(), and llvm::successors().
Referenced by llvm::DivergencePropagator< ContextT >::computeJoinPoints().
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 110 of file GenericCycleInfo.h.
Referenced by llvm::DivergencePropagator< ContextT >::computeJoinPoints(), llvm::getExtDivCycle(), llvm::getIntDivCycle(), and llvm::GenericCycleInfo< ContextT >::verifyCycleNest().
|
inline |
Definition at line 209 of file GenericCycleInfo.h.
References Blocks.
|
inline |
Definition at line 192 of file GenericCycleInfo.h.
|
inline |
Definition at line 221 of file GenericCycleInfo.h.
|
inline |
Definition at line 144 of file GenericCycleInfo.h.
|
inline |
Definition at line 143 of file GenericCycleInfo.h.
Referenced by llvm::DivergencePropagator< ContextT >::computeJoinPoints(), llvm::getExtDivCycle(), llvm::getIntDivCycle(), llvm::SIInstrInfo::isSafeToSink(), and llvm::GenericCycleInfo< SSAContext >::print().
|
inline |
Return whether Block
is an entry block of the cycle.
Definition at line 122 of file GenericCycleInfo.h.
References llvm::Block, and llvm::is_contained().
Referenced by llvm::GenericCycle< ContextT >::print().
|
inline |
Whether the cycle is a natural loop.
Definition at line 108 of file GenericCycleInfo.h.
Referenced by llvm::DivergencePropagator< ContextT >::computeJoinPoints(), llvm::getExtDivCycle(), and llvm::getIntDivCycle().
|
inline |
Definition at line 243 of file GenericCycleInfo.h.
References llvm::Block, Blocks, llvm::Depth, llvm::GenericCycle< ContextT >::isEntry(), and llvm::GenericCycle< ContextT >::printEntries().
Referenced by llvm::GenericCycleInfo< ContextT >::print().
|
inline |
Definition at line 231 of file GenericCycleInfo.h.
References llvm::First.
Referenced by llvm::GenericCycle< ContextT >::print().
|
inline |
Replace all entries with Block
as single entry.
Definition at line 127 of file GenericCycleInfo.h.
References assert(), llvm::Block, llvm::GenericCycle< ContextT >::clearCache(), and llvm::GenericCycle< ContextT >::contains().
void llvm::GenericCycle< ContextT >::verifyCycle |
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, Blocks, llvm::detail::DenseSetImpl< ValueT, MapTy, ValueInfoT >::contains(), contains(), llvm::SmallPtrSetImpl< PtrType >::count(), llvm::dbgs(), llvm::depth_first(), llvm::depth_first_ext(), llvm::detail::DenseSetImpl< ValueT, MapTy, ValueInfoT >::empty(), llvm::SmallVectorTemplateCommon< T, typename >::end(), getParent(), llvm::detail::DenseSetImpl< ValueT, MapTy, ValueInfoT >::insert(), llvm::df_iterator_default_set< NodeRef, SmallSize >::insert(), llvm::SmallPtrSetImpl< PtrType >::insert(), llvm_unreachable, and llvm::SmallPtrSetImplBase::size().
Referenced by llvm::GenericCycleInfo< ContextT >::verifyCycleNest().
void llvm::GenericCycle< ContextT >::verifyCycleNest |
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(), llvm::Depth, and llvm::is_contained().
Referenced by llvm::GenericCycleInfo< ContextT >::verifyCycleNest().
Definition at line 48 of file GenericCycleInfo.h.
Definition at line 49 of file GenericCycleInfo.h.