Skip to content

Commit

Permalink
Revert "[Support] Assert that DomTree nodes share parent" (#102780)
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalybuka committed Aug 11, 2024
1 parent 8c4e039 commit 3c3df1b
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 44 deletions.
2 changes: 0 additions & 2 deletions llvm/include/llvm/Support/GenericDomTree.h
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,6 @@ class DominatorTreeBase {
/// may (but is not required to) be null for a forward (backwards)
/// statically unreachable block.
DomTreeNodeBase<NodeT> *getNode(const NodeT *BB) const {
assert((!BB || Parent == NodeTrait::getParent(const_cast<NodeT *>(BB))) &&
"cannot get DomTreeNode of block with different parent");
if (auto Idx = getNodeIndex(BB); Idx && *Idx < DomTreeNodes.size())
return DomTreeNodes[*Idx].get();
return nullptr;
Expand Down
2 changes: 0 additions & 2 deletions llvm/lib/Analysis/TypeMetadataUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ findCallsAtConstantOffset(SmallVectorImpl<DevirtCallSite> &DevirtCalls,
// after indirect call promotion and inlining, where we may have uses
// of the vtable pointer guarded by a function pointer check, and a fallback
// indirect call.
if (CI->getFunction() != User->getFunction())
continue;
if (!DT.dominates(CI, User))
continue;
if (isa<BitCastInst>(User)) {
Expand Down
1 change: 0 additions & 1 deletion llvm/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ bool AlignmentFromAssumptionsPass::processAssumption(CallInst *ACall,
continue;

if (Instruction *K = dyn_cast<Instruction>(J))
if (K->getFunction() == ACall->getFunction())
WorkList.push_back(K);
}

Expand Down
8 changes: 2 additions & 6 deletions llvm/lib/Transforms/Scalar/LoopFuse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1729,9 +1729,7 @@ struct LoopFuser {
// mergeLatch may remove the only block in FC1.
SE.forgetLoop(FC1.L);
SE.forgetLoop(FC0.L);
// Forget block dispositions as well, so that there are no dangling
// pointers to erased/free'ed blocks.
SE.forgetBlockAndLoopDispositions();
SE.forgetLoopDispositions();

// Move instructions from FC0.Latch to FC1.Latch.
// Note: mergeLatch requires an updated DT.
Expand Down Expand Up @@ -2025,9 +2023,7 @@ struct LoopFuser {
// mergeLatch may remove the only block in FC1.
SE.forgetLoop(FC1.L);
SE.forgetLoop(FC0.L);
// Forget block dispositions as well, so that there are no dangling
// pointers to erased/free'ed blocks.
SE.forgetBlockAndLoopDispositions();
SE.forgetLoopDispositions();

// Move instructions from FC0.Latch to FC1.Latch.
// Note: mergeLatch requires an updated DT.
Expand Down
33 changes: 0 additions & 33 deletions llvm/test/Transforms/AlignmentFromAssumptions/domtree-crash.ll

This file was deleted.

0 comments on commit 3c3df1b

Please sign in to comment.