LLVM: llvm::DomTreeUpdater Class Reference (original) (raw)
#include "[llvm/Analysis/DomTreeUpdater.h](DomTreeUpdater%5F8h%5Fsource.html)"
Public Types | |
---|---|
using | Base = GenericDomTreeUpdater< DomTreeUpdater, DominatorTree, PostDominatorTree > |
![]() |
|
enum | UpdateStrategy |
using | BasicBlockT = typename DomTreeT::NodeType |
using | UpdateT = typename DomTreeT::UpdateType |
Public Member Functions | |
---|---|
~DomTreeUpdater () | |
LLVM_DUMP_METHOD void | dump () const |
Debug method to help view the internal state of this class. | |
Mutation APIs | |
These methods provide APIs for submitting updates to the DominatorTree and the PostDominatorTree. Note: There are two strategies to update the DominatorTree and the PostDominatorTree: Eager UpdateStrategy: Updates are submitted and then flushed immediately. Lazy UpdateStrategy: Updates are submitted but only flushed when you explicitly call Flush APIs. It is recommended to use this update strategy when you submit a bunch of updates multiple times which can then add up to a large number of updates between two queries on the DominatorTree. The incremental updater can reschedule the updates or decide to recalculate the dominator tree in order to speedup the updating process depending on the number of updates. Although GenericDomTree provides several update primitives, it is not encouraged to use these APIs directly. | |
void | deleteBB (BasicBlock *DelBB) |
Delete DelBB. | |
void | callbackDeleteBB (BasicBlock *DelBB, std::function< void(BasicBlock *)> Callback) |
Delete DelBB. | |
![]() |
|
GenericDomTreeUpdater (UpdateStrategy Strategy_) | |
GenericDomTreeUpdater (DominatorTree &DT_, UpdateStrategy Strategy_) | |
GenericDomTreeUpdater (DominatorTree *DT_, UpdateStrategy Strategy_) | |
GenericDomTreeUpdater (PostDominatorTree &PDT_, UpdateStrategy Strategy_) | |
GenericDomTreeUpdater (PostDominatorTree *PDT_, UpdateStrategy Strategy_) | |
GenericDomTreeUpdater (DominatorTree &DT_, PostDominatorTree &PDT_, UpdateStrategy Strategy_) | |
GenericDomTreeUpdater (DominatorTree *DT_, PostDominatorTree *PDT_, UpdateStrategy Strategy_) | |
~GenericDomTreeUpdater () | |
bool | isLazy () const |
Returns true if the current strategy is Lazy. | |
bool | isEager () const |
Returns true if the current strategy is Eager. | |
bool | hasDomTree () const |
Returns true if it holds a DomTreeT. | |
bool | hasPostDomTree () const |
Returns true if it holds a PostDomTreeT. | |
bool | hasPendingDeletedBB () const |
Returns true if there is BasicBlockT awaiting deletion. | |
bool | isBBPendingDeletion (BasicBlockT *DelBB) const |
Returns true if DelBB is awaiting deletion. | |
bool | hasPendingUpdates () const |
Returns true if either of DT or PDT is valid and the tree has at least one update pending. | |
bool | hasPendingDomTreeUpdates () const |
Returns true if there are DomTreeT updates queued. | |
bool | hasPendingPostDomTreeUpdates () const |
Returns true if there are PostDomTreeT updates queued. | |
LLVM_DUMP_METHOD void | dump () const |
Debug method to help view the internal state of this class. | |
void | recalculate (FuncT &F) |
Notify DTU that the entry block was replaced. | |
void | applyUpdates (ArrayRef< UpdateT > Updates) |
Submit updates to all available trees. | |
void | splitCriticalEdge (BasicBlockT *FromBB, BasicBlockT *ToBB, BasicBlockT *NewBB) |
Apply updates that the critical edge (FromBB, ToBB) has been split with NewBB. | |
void | applyUpdatesPermissive (ArrayRef< UpdateT > Updates) |
Submit updates to all available trees. | |
DominatorTree & | getDomTree () |
Flush DomTree updates and return DomTree. | |
PostDominatorTree & | getPostDomTree () |
Flush PostDomTree updates and return PostDomTree. | |
void | flush () |
Apply all pending updates to available trees and flush all BasicBlocks awaiting deletion. | |
Additional Inherited Members | |
---|---|
![]() |
|
bool | isSelfDominance (UpdateT Update) const |
Returns true if the update is self dominance. | |
void | applyDomTreeUpdates () |
Helper function to apply all pending DomTree updates. | |
void | applyPostDomTreeUpdates () |
Helper function to apply all pending PostDomTree updates. | |
bool | isUpdateValid (UpdateT Update) const |
Returns true if the update appears in the LLVM IR. | |
void | eraseDelBBNode (BasicBlockT *DelBB) |
Erase Basic Block node before it is unlinked from Function in the DomTree and PostDomTree. | |
void | tryFlushDeletedBB () |
Helper function to flush deleted BasicBlocks if all available trees are up-to-date. | |
void | dropOutOfDateUpdates () |
Drop all updates applied by all available trees and delete BasicBlocks if all available trees are up-to-date. | |
![]() |
|
SmallVector< DomTreeUpdate, 16 > | PendUpdates |
size_t | PendDTUpdateIndex |
size_t | PendPDTUpdateIndex |
DominatorTree * | DT |
PostDominatorTree * | PDT |
const UpdateStrategy | Strategy |
SmallPtrSet< BasicBlockT *, 8 > | DeletedBBs |
bool | IsRecalculatingDomTree |
bool | IsRecalculatingPostDomTree |
◆ Base
llvm::DomTreeUpdater::~DomTreeUpdater ( ) | inline |
---|
◆ callbackDeleteBB()
void llvm::DomTreeUpdater::callbackDeleteBB | ( | BasicBlock * | DelBB, |
---|---|---|---|
std::function< void(BasicBlock *)> | Callback | ||
) |
Delete DelBB.
DelBB will be removed from its Parent and erased from available trees if it exists. Then the callback will be called. Finally, DelBB will be deleted. Under Eager UpdateStrategy, DelBB will be processed immediately. Under Lazy UpdateStrategy, DelBB will be queued until a flush event and all available trees are up-to-date. Assert if any instruction of DelBB is modified while awaiting deletion. Multiple callbacks can be queued for one DelBB under Lazy UpdateStrategy.
Definition at line 73 of file DomTreeUpdater.cpp.
References llvm::GenericDomTreeUpdater< DomTreeUpdater, DominatorTree, PostDominatorTree >::DeletedBBs, llvm::GenericDomTreeUpdater< DomTreeUpdater, DominatorTree, PostDominatorTree >::eraseDelBBNode(), llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::BasicBlock::removeFromParent(), and llvm::GenericDomTreeUpdater< DomTreeUpdater, DominatorTree, PostDominatorTree >::Strategy.
◆ deleteBB()
void llvm::DomTreeUpdater::deleteBB | ( | BasicBlock * | DelBB | ) |
---|
Delete DelBB.
DelBB will be removed from its Parent and erased from available trees if it exists and finally get deleted. Under Eager UpdateStrategy, DelBB will be processed immediately. Under Lazy UpdateStrategy, DelBB will be queued until a flush event and all available trees are up-to-date. Assert if any instruction of DelBB is modified while awaiting deletion. When both DT and PDT are nullptrs, DelBB will be queued until flush() is called.
Definition at line 62 of file DomTreeUpdater.cpp.
References llvm::GenericDomTreeUpdater< DomTreeUpdater, DominatorTree, PostDominatorTree >::DeletedBBs, llvm::GenericDomTreeUpdater< DomTreeUpdater, DominatorTree, PostDominatorTree >::eraseDelBBNode(), llvm::BasicBlock::eraseFromParent(), llvm::SmallPtrSetImpl< PtrType >::insert(), and llvm::GenericDomTreeUpdater< DomTreeUpdater, DominatorTree, PostDominatorTree >::Strategy.
Referenced by llvm::DeleteDeadBlocks(), llvm::MergeBasicBlockIntoOnlyPred(), runSCCP(), and splitCallSite().
◆ dump()
The documentation for this class was generated from the following files:
- include/llvm/Analysis/DomTreeUpdater.h
- lib/Analysis/DomTreeUpdater.cpp