24template class GenericDomTreeUpdater<DomTreeUpdater, DominatorTree,
28GenericDomTreeUpdater<DomTreeUpdater, DominatorTree,
29 PostDominatorTree>::recalculate(Function &
F);
32GenericDomTreeUpdater<DomTreeUpdater, DominatorTree, PostDominatorTree>::
33 applyUpdatesImpl<
true>();
35GenericDomTreeUpdater<DomTreeUpdater, DominatorTree, PostDominatorTree>::
36 applyUpdatesImpl<
false>();
38bool DomTreeUpdater::forceFlushDeletedBB() {
47 assert(BB->size() == 1 && isa<UnreachableInst>(BB->getTerminator()) &&
48 "DelBB has been modified while awaiting deletion.");
50 BB->eraseFromParent();
63 validateDeleteBB(DelBB);
64 if (
Strategy == UpdateStrategy::Lazy) {
75 validateDeleteBB(DelBB);
76 if (
Strategy == UpdateStrategy::Lazy) {
77 Callbacks.push_back(CallBackOnDeletion(DelBB, Callback));
88void DomTreeUpdater::validateDeleteBB(
BasicBlock *DelBB) {
89 assert(DelBB &&
"Invalid push_back of nullptr DelBB.");
92 while (!DelBB->
empty()) {
101 new UnreachableInst(DelBB->
getContext(), DelBB);
107#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
109 OS <<
"Pending Callbacks:\n";
111 for (
const auto &BB : Callbacks) {
115 OS << BB->getName() <<
"(";
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds.
This file contains the declarations for the subclasses of Constant, which represent the different fla...
This file defines a set of templates that efficiently compute a dominator tree over a generic graph.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
LLVM Basic Block Representation.
void removeFromParent()
Unlink 'this' from the containing function, but do not delete it.
SymbolTableList< BasicBlock >::iterator eraseFromParent()
Unlink 'this' from the containing function and delete it.
LLVMContext & getContext() const
Get the context in which this basic block lives.
const Instruction & back() const
LLVM_DUMP_METHOD void dump() const
Debug method to help view the internal state of this class.
void callbackDeleteBB(BasicBlock *DelBB, std::function< void(BasicBlock *)> Callback)
Delete DelBB.
void deleteBB(BasicBlock *DelBB)
Delete DelBB.
SmallPtrSet< BasicBlockT *, 8 > DeletedBBs
void eraseDelBBNode(BasicBlockT *DelBB)
Erase Basic Block node before it is unlinked from Function in the DomTree and PostDomTree.
const UpdateStrategy Strategy
LLVM_DUMP_METHOD void dump() const
Debug method to help view the internal state of this class.
InstListType::iterator eraseFromParent()
This method unlinks 'this' from the containing basic block and deletes it.
static PoisonValue * get(Type *T)
Static factory methods - Return an 'poison' object of the specified type.
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
This class implements an extremely fast bulk output stream that can only output to a stream.
This is an optimization pass for GlobalISel generic memory operations.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
bool pred_empty(const BasicBlock *BB)