27template class GenericDomTreeUpdater<DomTreeUpdater, DominatorTree,
31GenericDomTreeUpdater<DomTreeUpdater, DominatorTree,
32 PostDominatorTree>::recalculate(Function &
F);
34bool DomTreeUpdater::forceFlushDeletedBB() {
43 assert(BB->size() == 1 && isa<UnreachableInst>(BB->getTerminator()) &&
44 "DelBB has been modified while awaiting deletion.");
46 BB->eraseFromParent();
59 validateDeleteBB(DelBB);
60 if (
Strategy == UpdateStrategy::Lazy) {
71 validateDeleteBB(DelBB);
72 if (
Strategy == UpdateStrategy::Lazy) {
73 Callbacks.push_back(CallBackOnDeletion(DelBB, Callback));
84void DomTreeUpdater::validateDeleteBB(
BasicBlock *DelBB) {
85 assert(DelBB &&
"Invalid push_back of nullptr DelBB.");
88 while (!DelBB->
empty()) {
97 new UnreachableInst(DelBB->
getContext(), DelBB);
101void DomTreeUpdater::dump()
const {
103#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
105 OS <<
"Pending Callbacks:\n";
107 for (
const auto &BB : Callbacks) {
111 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())
This file defines the SmallSet class.
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
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 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)