aboutsummaryrefslogtreecommitdiff
path: root/lib/VMCore/BasicBlock.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-02-23 07:09:08 +0000
committerChris Lattner <sabre@nondot.org>2005-02-23 07:09:08 +0000
commit35f0aecdb012ba150953f6f3a98862be9c72d265 (patch)
treede3fc5d876f5d4ba9e2664efe82c12c21aa160e1 /lib/VMCore/BasicBlock.cpp
parent9b5b1905dbad19de374e7617f615ba522ffe0468 (diff)
Reduce the amount of searching this assertion does. On a testcase of mine,
this reduces the time for -simplifycfg in a debug build from 106s to 14.82s git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20286 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/BasicBlock.cpp')
-rw-r--r--lib/VMCore/BasicBlock.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/VMCore/BasicBlock.cpp b/lib/VMCore/BasicBlock.cpp
index 87b9ddd380..ae6356bc70 100644
--- a/lib/VMCore/BasicBlock.cpp
+++ b/lib/VMCore/BasicBlock.cpp
@@ -136,8 +136,10 @@ void BasicBlock::dropAllReferences() {
// called while the predecessor still refers to this block.
//
void BasicBlock::removePredecessor(BasicBlock *Pred) {
- assert(find(pred_begin(this), pred_end(this), Pred) != pred_end(this) &&
+ assert((getNumUses() > 16 ||// Reduce cost of this assertion for complex CFGs.
+ find(pred_begin(this), pred_end(this), Pred) != pred_end(this)) &&
"removePredecessor: BB is not a predecessor!");
+
if (InstList.empty()) return;
PHINode *APN = dyn_cast<PHINode>(&front());
if (!APN) return; // Quick exit.