Don't generate branch to entry block.

llvm-svn: 36917
This commit is contained in:
Dale Johannesen 2007-05-08 01:01:04 +00:00
parent 4f648c68cd
commit 842aef302e

View File

@ -280,7 +280,9 @@ static void SplitEdgeNicely(TerminatorInst *TI, unsigned SuccNum, Pass *P) {
BranchInst *PredBr = dyn_cast<BranchInst>(Pred->getTerminator());
if (!PredBr || !PredBr->isUnconditional() ||
// Must be empty other than the branch.
&Pred->front() != PredBr)
&Pred->front() != PredBr ||
// Cannot be the entry block; its label does not get emitted.
Pred == &(Dest->getParent()->getEntryBlock()))
continue;
// Finally, since we know that Dest has phi nodes in it, we have to make