aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/IfConversion.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2007-05-18 17:06:53 +0000
committerEvan Cheng <evan.cheng@apple.com>2007-05-18 17:06:53 +0000
commit6092ca155610b6c4cb16f21a1dad1f990758730a (patch)
tree5d22bb8c299362c5f35dab849c4d6d99a52f5c81 /lib/CodeGen/IfConversion.cpp
parent7d841a4914ad92a4b54f3b515c6e50affa9b2614 (diff)
Watch out for blocks that end with a return.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37227 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/IfConversion.cpp')
-rw-r--r--lib/CodeGen/IfConversion.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/CodeGen/IfConversion.cpp b/lib/CodeGen/IfConversion.cpp
index a98f04b1ef..a93175ec41 100644
--- a/lib/CodeGen/IfConversion.cpp
+++ b/lib/CodeGen/IfConversion.cpp
@@ -316,7 +316,7 @@ bool IfConverter::IfConvertDiamond(BBInfo &BBI) {
// 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 @@ bool IfConverter::IfConvertDiamond(BBInfo &BBI) {
// 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