forked from OSchip/llvm-project
LoopIndexSplit can sometimes result in cases where a block in its own domfrontier.
Don't crash when we encounter one of these. llvm-svn: 51915
This commit is contained in:
parent
ec62418fc5
commit
2df82e7cec
|
@ -235,10 +235,13 @@ bool llvm::SplitCriticalEdge(TerminatorInst *TI, unsigned SuccNum, Pass *P,
|
|||
DominanceFrontier::iterator I = DF->find(DestBB);
|
||||
if (I != DF->end()) {
|
||||
DF->addBasicBlock(NewBB, I->second);
|
||||
|
||||
if (I->second.count(DestBB)) {
|
||||
// However NewBB's frontier does not include DestBB.
|
||||
DominanceFrontier::iterator NF = DF->find(NewBB);
|
||||
DF->removeFromFrontier(NF, DestBB);
|
||||
}
|
||||
}
|
||||
else
|
||||
DF->addBasicBlock(NewBB, DominanceFrontier::DomSetType());
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue