diff options
author | Cong Hou <congh@google.com> | 2015-12-01 21:50:20 +0000 |
---|---|---|
committer | Cong Hou <congh@google.com> | 2015-12-01 21:50:20 +0000 |
commit | cb07d7016a16fb1257cf882f9b71b97d08953d0b (patch) | |
tree | 6abf8fea31f78ac41dcc3c831cde5affdd3c125f | |
parent | b258d794dd09048672dd49928c7a404ab22a327c (diff) | |
download | bcm5719-llvm-cb07d7016a16fb1257cf882f9b71b97d08953d0b.tar.gz bcm5719-llvm-cb07d7016a16fb1257cf882f9b71b97d08953d0b.zip |
Fix a bug in IfConversion.cpp.
The bug is introduced in r254377 which failed some tests on ARM, where a new
probability is assigned to a successor but the provided BB may not be a
successor.
llvm-svn: 254463
-rw-r--r-- | llvm/lib/CodeGen/IfConversion.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/IfConversion.cpp b/llvm/lib/CodeGen/IfConversion.cpp index ff28f95cc33..e90cb02bd28 100644 --- a/llvm/lib/CodeGen/IfConversion.cpp +++ b/llvm/lib/CodeGen/IfConversion.cpp @@ -1254,9 +1254,8 @@ bool IfConverter::IfConvertTriangle(BBInfo &BBI, IfcvtKind Kind) { auto NewNext = BBNext + BBCvt * CvtNext; auto NewTrueBBIter = std::find(BBI.BB->succ_begin(), BBI.BB->succ_end(), NewTrueBB); - assert(NewTrueBBIter != BBI.BB->succ_end() && - "NewTrueBB is not a successor of BBI.BB."); - BBI.BB->setSuccProbability(NewTrueBBIter, NewNext); + if (NewTrueBBIter != BBI.BB->succ_end()) + BBI.BB->setSuccProbability(NewTrueBBIter, NewNext); auto NewFalse = BBCvt * CvtFalse; TII->InsertBranch(*BBI.BB, CvtBBI->FalseBB, nullptr, RevCond, dl); |