If NewBB dominates DestBB then DestBB is not part of NewBB's dominance frontier.

llvm-svn: 41051
This commit is contained in:
Devang Patel 2007-08-13 21:59:17 +00:00
parent 2b40caa861
commit da48cf40db
1 changed files with 5 additions and 1 deletions

View File

@ -227,8 +227,12 @@ bool llvm::SplitCriticalEdge(TerminatorInst *TI, unsigned SuccNum, Pass *P,
DominanceFrontier::DomSetType NewDFSet;
if (NewBBDominatesDestBB) {
DominanceFrontier::iterator I = DF->find(DestBB);
if (I != DF->end())
if (I != DF->end()) {
DF->addBasicBlock(NewBB, I->second);
// 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 {