From 35f0aecdb012ba150953f6f3a98862be9c72d265 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 23 Feb 2005 07:09:08 +0000 Subject: [PATCH] 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 --- lib/VMCore/BasicBlock.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/VMCore/BasicBlock.cpp b/lib/VMCore/BasicBlock.cpp index 87b9ddd3808..ae6356bc705 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(&front()); if (!APN) return; // Quick exit.