Changes in directory llvm/lib/Transforms/Scalar:

CodeGenPrepare.cpp updated: 1.10 -> 1.11
---
Log message:

Don't generate branch to entry block.


---
Diffs of the changes:  (+3 -1)

 CodeGenPrepare.cpp |    4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)


Index: llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp
diff -u llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp:1.10 
llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp:1.11
--- llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp:1.10  Sun May  6 08:37:16 2007
+++ llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp       Mon May  7 20:01:04 2007
@@ -280,7 +280,9 @@
     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



_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to