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

Evan Cheng evan.cheng at apple.com
Fri May 18 10:07:14 PDT 2007



Changes in directory llvm/lib/CodeGen:

IfConversion.cpp updated: 1.6 -> 1.7
---
Log message:

Watch out for blocks that end with a return.

---
Diffs of the changes:  (+2 -2)

 IfConversion.cpp |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


Index: llvm/lib/CodeGen/IfConversion.cpp
diff -u llvm/lib/CodeGen/IfConversion.cpp:1.6 llvm/lib/CodeGen/IfConversion.cpp:1.7
--- llvm/lib/CodeGen/IfConversion.cpp:1.6	Thu May 17 20:55:58 2007
+++ llvm/lib/CodeGen/IfConversion.cpp	Fri May 18 12:06:53 2007
@@ -316,7 +316,7 @@
 
     // Either the 'true' block fallthrough to another block or it ends with a
     // return. If it's the former, add a conditional branch to its successor.
-    if (!TrueBBI.TrueBB)
+    if (!TrueBBI.TrueBB && BBI.TrueBB->succ_size())
       TII->InsertBranch(*BBI.TrueBB, *BBI.TrueBB->succ_begin(), NULL, BBI.Cond);
 
     // Predicate the 'false' block.
@@ -326,7 +326,7 @@
 
     // Either the 'false' block fallthrough to another block or it ends with a
     // return. If it's the former, add a conditional branch to its successor.
-    if (!FalseBBI.TrueBB)
+    if (!FalseBBI.TrueBB && BBI.FalseBB->succ_size())
       TII->InsertBranch(*BBI.FalseBB, *BBI.FalseBB->succ_begin(), NULL,NewCond);
 
     // Merge the 'true' and 'false' blocks by copying the instructions






More information about the llvm-commits mailing list