|
LLVM 23.0.0git
|
Cycle information for a function. More...
#include "llvm/ADT/GenericCycleInfo.h"
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 |
| Iteration over top-level cycles. | |
Public Member Functions | |
| GenericCycleInfo ()=default | |
| GenericCycleInfo (GenericCycleInfo &&)=default | |
| GenericCycleInfo & | operator= (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 FunctionT * | getFunction () const |
| const ContextT & | getSSAContext () const |
| CycleT * | getCycle (const BlockT *Block) const |
| Find the innermost cycle containing a given block. | |
| CycleT * | getSmallestCommonCycle (CycleT *A, CycleT *B) const |
| Find the innermost cycle containing both given cycles. | |
| CycleT * | getSmallestCommonCycle (BlockT *A, BlockT *B) const |
| Find the innermost cycle containing both given blocks. | |
| unsigned | getCycleDepth (const BlockT *Block) const |
| get the depth for the cycle which containing a given block. | |
| CycleT * | getTopLevelParentCycle (const BlockT *Block) const |
| void | addBlockToCycle (BlockT *Block, CycleT *Cycle) |
Assumes that Cycle is the innermost cycle containing Block. | |
| void | verifyCycleNest (bool VerifyFull=false) const |
| Methods for debug and self-test. | |
| void | verify () const |
| Verify that the entire cycle tree well-formed. | |
| 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_iterator > | toplevel_cycles () const |
Friends | |
| template<typename> | |
| class | GenericCycle |
| template<typename> | |
| class | GenericCycleInfoCompute |
Cycle information for a function.
Definition at line 259 of file GenericCycleInfo.h.
| using llvm::GenericCycleInfo< ContextT >::BlockT = typename ContextT::BlockT |
Definition at line 261 of file GenericCycleInfo.h.
| using llvm::GenericCycleInfo< ContextT >::const_toplevel_iterator_base |
Iteration over top-level cycles.
Definition at line 324 of file GenericCycleInfo.h.
| using llvm::GenericCycleInfo< ContextT >::CycleT = GenericCycle<ContextT> |
Definition at line 262 of file GenericCycleInfo.h.
| using llvm::GenericCycleInfo< ContextT >::FunctionT = typename ContextT::FunctionT |
Definition at line 263 of file GenericCycleInfo.h.
|
default |
Referenced by GenericCycleInfo(), and operator=().
|
default |
References GenericCycleInfo().
| void llvm::GenericCycleInfo< ContextT >::addBlockToCycle | ( | BlockT * | Block, |
| CycleT * | Cycle ) |
Assumes that Cycle is the innermost cycle containing Block.
Block will be appended to Cycle and all of its parent cycles. Block will be added to BlockMap with Cycle and BlockMapTopLevel with Cycle's top level parent cycle.
Definition at line 333 of file GenericCycleImpl.h.
References llvm::Block, and llvm::Number.
Referenced by fixIrreducible(), and splitCriticalEdge().
| void llvm::GenericCycleInfo< ContextT >::clear | ( | ) |
Reset the object to its initial state.
Definition at line 522 of file GenericCycleImpl.h.
| void llvm::GenericCycleInfo< ContextT >::compute | ( | FunctionT & | F | ) |
Compute the cycle info for a function.
Definition at line 529 of file GenericCycleImpl.h.
References llvm::errs(), F, GenericCycleInfoCompute, LLVM_DEBUG, and llvm::GenericCycleInfoCompute< ContextT >::run().
Referenced by llvm::CycleAnalysis::run(), and llvm::MachineCycleAnalysis::run().
|
inline |
Definition at line 318 of file GenericCycleInfo.h.
References llvm::dbgs(), and print().
| auto llvm::GenericCycleInfo< ContextT >::getCycle | ( | const BlockT * | Block | ) | const |
Find the innermost cycle containing a given block.
Block or nullptr if it is not contained in any cycle. Definition at line 558 of file GenericCycleImpl.h.
References llvm::Block, and llvm::Number.
Referenced by getCycleDepth(), getSmallestCommonCycle(), getTopLevelParentCycle(), llvm::isPotentiallyReachable(), llvm::SIInstrInfo::isSafeToSink(), mayBeInCycle(), splitCriticalEdge(), and verifyCycleNest().
| unsigned llvm::GenericCycleInfo< ContextT >::getCycleDepth | ( | const BlockT * | Block | ) | const |
get the depth for the cycle which containing a given block.
Block or 0 if it is not contained in any cycle. Definition at line 610 of file GenericCycleImpl.h.
References llvm::Block, and getCycle().
|
inline |
Definition at line 298 of file GenericCycleInfo.h.
| auto llvm::GenericCycleInfo< ContextT >::getSmallestCommonCycle | ( | BlockT * | A, |
| BlockT * | B ) const |
Find the innermost cycle containing both given blocks.
A and B or nullptr if there is no such cycle. Definition at line 599 of file GenericCycleImpl.h.
References A(), B(), getCycle(), and getSmallestCommonCycle().
| auto llvm::GenericCycleInfo< ContextT >::getSmallestCommonCycle | ( | CycleT * | A, |
| CycleT * | B ) const |
Find the innermost cycle containing both given cycles.
A and B or nullptr if there is no such cycle. Definition at line 570 of file GenericCycleImpl.h.
Referenced by getSmallestCommonCycle(), and splitCriticalEdge().
|
inline |
Definition at line 299 of file GenericCycleInfo.h.
| auto llvm::GenericCycleInfo< ContextT >::getTopLevelParentCycle | ( | const BlockT * | Block | ) | const |
Definition at line 286 of file GenericCycleImpl.h.
References llvm::Block, and getCycle().
Referenced by isReachableImpl().
|
default |
References F, and GenericCycleInfo().
|
inline |
Definition at line 319 of file GenericCycleInfo.h.
| void llvm::GenericCycleInfo< ContextT >::print | ( | raw_ostream & | Out | ) | const |
Print the cycle info.
Definition at line 652 of file GenericCycleImpl.h.
References llvm::depth_first(), I, and toplevel_cycles().
Referenced by dump(), and fixIrreducible().
| void llvm::GenericCycleInfo< ContextT >::splitCriticalEdge | ( | BlockT * | Pred, |
| BlockT * | Succ, | ||
| BlockT * | New ) |
Definition at line 541 of file GenericCycleImpl.h.
References addBlockToCycle(), getCycle(), getSmallestCommonCycle(), and verifyCycleNest().
|
inline |
Definition at line 340 of file GenericCycleInfo.h.
|
inline |
Definition at line 347 of file GenericCycleInfo.h.
References llvm::make_range().
Referenced by FixIrreducibleImpl(), print(), and verifyCycleNest().
|
inline |
Definition at line 343 of file GenericCycleInfo.h.
| void llvm::GenericCycleInfo< ContextT >::verify | ( | ) | const |
Verify that the entire cycle tree well-formed.
Definition at line 646 of file GenericCycleImpl.h.
References verifyCycleNest().
Referenced by FixIrreducibleImpl(), and llvm::CycleInfoVerifierPass::run().
| void llvm::GenericCycleInfo< ContextT >::verifyCycleNest | ( | bool | VerifyFull = false | ) | const |
Methods for debug and self-test.
Verify 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 622 of file GenericCycleImpl.h.
References assert(), llvm::depth_first(), getCycle(), llvm::detail::DenseSetImpl< ValueT, MapTy, ValueInfoT >::insert(), and toplevel_cycles().
Referenced by splitCriticalEdge(), and verify().
Definition at line 264 of file GenericCycleInfo.h.
References GenericCycle.
Referenced by GenericCycle.
Definition at line 265 of file GenericCycleInfo.h.
References llvm::Block, and GenericCycleInfoCompute.
Referenced by compute(), and GenericCycleInfoCompute.