In SjLj EH, the jump to the landing pad is not done explicitly through a branch
statement. The EH landing pad is added as a successor to the throwing
BB. Because of that however, the branch folding pass could mistakenly think that
it could merge the throwing BB with another BB. This isn't safe to do.
<rdar://problem/
10334833>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142891
91177308-0d34-0410-b5e6-
96231b3b80d8
// reinsert conditional branch only, for now
TII->InsertBranch(*PBB, (TBB == IBB) ? FBB : TBB, 0, NewCond, dl);
}
- MergePotentials.push_back(MergePotentialsElt(HashEndOfMBB(PBB), *P));
+ if (!PBB->getLandingPadSuccessor())
+ MergePotentials.push_back(MergePotentialsElt(HashEndOfMBB(PBB),*P));
}
}
// If this is a large problem, avoid visiting the same basic blocks