[llvm-commits] CVS: llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp

Dale Johannesen dalej at apple.com
Mon May 7 18:01:22 PDT 2007



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






More information about the llvm-commits mailing list