[llvm-commits] CVS: llvm/lib/CodeGen/BranchFolding.cpp

Dale Johannesen dalej at apple.com
Thu May 24 11:32:17 PDT 2007



Changes in directory llvm/lib/CodeGen:

BranchFolding.cpp updated: 1.57 -> 1.58
---
Log message:

Blocks that cond-br and uncond-br/fallthrough to same block should have
only one successor.


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

 BranchFolding.cpp |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletion(-)


Index: llvm/lib/CodeGen/BranchFolding.cpp
diff -u llvm/lib/CodeGen/BranchFolding.cpp:1.57 llvm/lib/CodeGen/BranchFolding.cpp:1.58
--- llvm/lib/CodeGen/BranchFolding.cpp:1.57	Thu May 24 12:39:32 2007
+++ llvm/lib/CodeGen/BranchFolding.cpp	Thu May 24 13:31:55 2007
@@ -672,7 +672,10 @@
   
   MachineBasicBlock::pred_iterator SI = MBB.succ_begin();
   while (SI != MBB.succ_end()) {
-    if (*SI == DestA) {
+    if (*SI == DestA && DestA == DestB) {
+      DestA = DestB = 0;
+      ++SI;
+    } else if (*SI == DestA) {
       DestA = 0;
       ++SI;
     } else if (*SI == DestB) {






More information about the llvm-commits mailing list