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
This commit is contained in:
Chris Lattner 2005-02-23 07:09:08 +00:00
parent 5e166a5f3e
commit cf08c21f2c
1 changed files with 3 additions and 1 deletions

View File

@ -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.