15 #ifndef LLVM_DOMTREEUPDATER_H 16 #define LLVM_DOMTREEUPDATER_H 33 : DT(&DT_), Strategy(Strategy_) {}
35 : DT(DT_), Strategy(Strategy_) {}
37 : PDT(&PDT_), Strategy(Strategy_) {}
39 : PDT(PDT_), Strategy(Strategy_) {}
42 : DT(&DT_), PDT(&PDT_), Strategy(Strategy_) {}
45 : DT(DT_), PDT(PDT_), Strategy(Strategy_) {}
96 bool ForceRemoveDuplicates =
false);
187 class CallBackOnDeletion final :
public CallbackVH {
191 :
CallbackVH(V), DelBB(V), Callback_(Callback) {}
195 std::function<void(BasicBlock *)> Callback_;
197 void deleted()
override {
204 size_t PendDTUpdateIndex = 0;
205 size_t PendPDTUpdateIndex = 0;
210 std::vector<CallBackOnDeletion> Callbacks;
211 bool IsRecalculatingDomTree =
false;
212 bool IsRecalculatingPostDomTree =
false;
222 bool forceFlushDeletedBB();
230 void applyDomTreeUpdates();
233 void applyPostDomTreeUpdates();
237 void tryFlushDeletedBB();
241 void dropOutOfDateUpdates();
257 #endif // LLVM_DOMTREEUPDATER_H DomTreeUpdater(DominatorTree &DT_, UpdateStrategy Strategy_)
DomTreeUpdater(DominatorTree *DT_, UpdateStrategy Strategy_)
This class represents lattice values for constants.
DominatorTree & getDomTree()
Flush DomTree updates and return DomTree.
bool hasPostDomTree() const
Returns true if it holds a PostDominatorTree.
void flush()
Apply all pending updates to available trees and flush all BasicBlocks awaiting deletion.
bool isLazy() const
Returns true if the current strategy is Lazy.
DomTreeUpdater(PostDominatorTree &PDT_, UpdateStrategy Strategy_)
DomTreeUpdater(PostDominatorTree *PDT_, UpdateStrategy Strategy_)
cfg::Update< NodePtr > UpdateType
PostDominatorTree & getPostDomTree()
Flush PostDomTree updates and return PostDomTree.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
DomTreeUpdater(DominatorTree &DT_, PostDominatorTree &PDT_, UpdateStrategy Strategy_)
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree...
LLVM Basic Block Representation.
void deleteBB(BasicBlock *DelBB)
Delete DelBB.
DomTreeUpdater(DominatorTree *DT_, PostDominatorTree *PDT_, UpdateStrategy Strategy_)
bool isEager() const
Returns true if the current strategy is Eager.
virtual void deleted()
Callback for Value destruction.
void deleteEdge(BasicBlock *From, BasicBlock *To)
Notify all available trees on an edge deletion.
bool hasPendingDeletedBB() const
Returns true if there is BasicBlock awaiting deletion.
void insertEdge(BasicBlock *From, BasicBlock *To)
Notify all available trees on an edge insertion.
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements...
BlockVerifier::State From
bool hasPendingUpdates() const
Returns true if either of DT or PDT is valid and the tree has at least one update pending...
void applyUpdates(ArrayRef< DominatorTree::UpdateType > Updates, bool ForceRemoveDuplicates=false)
Apply updates on all available trees.
PostDominatorTree Class - Concrete subclass of DominatorTree that is used to compute the post-dominat...
void deleteEdgeRelaxed(BasicBlock *From, BasicBlock *To)
Notify all available trees on an edge deletion.
void recalculate(Function &F)
Recalculate all available trees and flush all BasicBlocks awaiting deletion immediately.
bool hasPendingDomTreeUpdates() const
Returns true if there are DominatorTree updates queued.
cfg::UpdateKind UpdateKind
void insertEdgeRelaxed(BasicBlock *From, BasicBlock *To)
Notify all available trees on an edge insertion.
void callbackDeleteBB(BasicBlock *DelBB, std::function< void(BasicBlock *)> Callback)
Delete DelBB.
bool isBBPendingDeletion(BasicBlock *DelBB) const
Returns true if DelBB is awaiting deletion.
bool hasPendingPostDomTreeUpdates() const
Returns true if there are PostDominatorTree updates queued.
LLVM_DUMP_METHOD void dump() const
Debug method to help view the internal state of this class.
print Print MemDeps of function
This file defines a set of templates that efficiently compute a dominator tree over a generic graph...
Value handle with callbacks on RAUW and destruction.
DomTreeUpdater(UpdateStrategy Strategy_)
bool hasDomTree() const
Returns true if it holds a DominatorTree.