summaryrefslogtreecommitdiffstats
path: root/llvm/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
commitcf08c21f2cc6bdfa64816ee5128a1c58747dd1ad (patch)
treef93415f9054a8d84e7b051e99808ffb90698ac89 /llvm/lib/VMCore/BasicBlock.cpp
parent5e166a5f3efdbf06fad4834b27faf4156b61ee71 (diff)
downloadbcm5719-llvm-cf08c21f2cc6bdfa64816ee5128a1c58747dd1ad.tar.gz
bcm5719-llvm-cf08c21f2cc6bdfa64816ee5128a1c58747dd1ad.zip
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 llvm-svn: 20286
Diffstat (limited to 'llvm/lib/VMCore/BasicBlock.cpp')
-rw-r--r--llvm/lib/VMCore/BasicBlock.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/VMCore/BasicBlock.cpp b/llvm/lib/VMCore/BasicBlock.cpp
index 87b9ddd3808..ae6356bc705 100644
--- a/llvm/lib/VMCore/BasicBlock.cpp
+++ b/llvm/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.
OpenPOWER on IntegriCloud