diff options
| author | Evan Cheng <evan.cheng@apple.com> | 2007-05-18 17:06:53 +0000 |
|---|---|---|
| committer | Evan Cheng <evan.cheng@apple.com> | 2007-05-18 17:06:53 +0000 |
| commit | f25d3a5d7349a6839934c3d82ebd5cc02124b67f (patch) | |
| tree | bbeaa11cfa084ddac65b67398acf7c2735ee87c0 /llvm/lib/CodeGen | |
| parent | 76256a069c671c2ccdfd80bb0eed11800f30fe6a (diff) | |
| download | bcm5719-llvm-f25d3a5d7349a6839934c3d82ebd5cc02124b67f.tar.gz bcm5719-llvm-f25d3a5d7349a6839934c3d82ebd5cc02124b67f.zip | |
Watch out for blocks that end with a return.
llvm-svn: 37227
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/IfConversion.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/IfConversion.cpp b/llvm/lib/CodeGen/IfConversion.cpp index a98f04b1ef2..a93175ec414 100644 --- a/llvm/lib/CodeGen/IfConversion.cpp +++ b/llvm/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 |

