diff options
author | Dale Johannesen <dalej@apple.com> | 2007-05-08 01:01:04 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2007-05-08 01:01:04 +0000 |
commit | 6603a1bff0e25e1d9f7be08c65c7b584c7bb84d7 (patch) | |
tree | f637555567ed49184499b2eff7f6ca83c0f1dcd2 | |
parent | 356e72c4f1a90b0ff306838e8841b9b550460cd9 (diff) |
Don't generate branch to entry block.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36917 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Transforms/Scalar/CodeGenPrepare.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/CodeGenPrepare.cpp b/lib/Transforms/Scalar/CodeGenPrepare.cpp index cb7d1e8221..9fa044e4c7 100644 --- a/lib/Transforms/Scalar/CodeGenPrepare.cpp +++ b/lib/Transforms/Scalar/CodeGenPrepare.cpp @@ -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 |