mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-15 22:28:18 +00:00
LoopIndexSplit can sometimes result in cases where a block in its own domfrontier.
Don't crash when we encounter one of these. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51915 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -235,9 +235,12 @@ bool llvm::SplitCriticalEdge(TerminatorInst *TI, unsigned SuccNum, Pass *P,
|
|||||||
DominanceFrontier::iterator I = DF->find(DestBB);
|
DominanceFrontier::iterator I = DF->find(DestBB);
|
||||||
if (I != DF->end()) {
|
if (I != DF->end()) {
|
||||||
DF->addBasicBlock(NewBB, I->second);
|
DF->addBasicBlock(NewBB, I->second);
|
||||||
// However NewBB's frontier does not include DestBB.
|
|
||||||
DominanceFrontier::iterator NF = DF->find(NewBB);
|
if (I->second.count(DestBB)) {
|
||||||
DF->removeFromFrontier(NF, DestBB);
|
// However NewBB's frontier does not include DestBB.
|
||||||
|
DominanceFrontier::iterator NF = DF->find(NewBB);
|
||||||
|
DF->removeFromFrontier(NF, DestBB);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
DF->addBasicBlock(NewBB, DominanceFrontier::DomSetType());
|
DF->addBasicBlock(NewBB, DominanceFrontier::DomSetType());
|
||||||
|
Reference in New Issue
Block a user