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
This commit is contained in:
Chris Lattner 2005-02-23 07:09:08 +00:00
parent 9b5b1905db
commit 35f0aecdb0

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.