recommit r108131 (hich has been backed out in r108135) with a fix

llvm-svn: 108137
This commit is contained in:
Gabor Greif 2010-07-12 12:02:10 +00:00
parent 35473faa50
commit 433b975fe2
1 changed files with 3 additions and 2 deletions

View File

@ -206,12 +206,13 @@ static BasicBlock *FindObviousSharedDomOf(BasicBlock *SrcBlock,
// there is only one other pred, get it, otherwise we can't handle it.
PI = pred_begin(DstBlock); PE = pred_end(DstBlock);
BasicBlock *DstOtherPred = 0;
if (*PI == SrcBlock) {
BasicBlock *P = *PI;
if (P == SrcBlock) {
if (++PI == PE) return 0;
DstOtherPred = *PI;
if (++PI != PE) return 0;
} else {
DstOtherPred = *PI;
DstOtherPred = P;
if (++PI == PE || *PI != SrcBlock || ++PI != PE) return 0;
}