[llvm-commits] CVS: llvm/lib/VMCore/BasicBlock.cpp

Chris Lattner lattner at cs.uiuc.edu
Tue Feb 22 23:09:21 PST 2005



Changes in directory llvm/lib/VMCore:

BasicBlock.cpp updated: 1.54 -> 1.55
---
Log message:

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


---
Diffs of the changes:  (+3 -1)

 BasicBlock.cpp |    4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)


Index: llvm/lib/VMCore/BasicBlock.cpp
diff -u llvm/lib/VMCore/BasicBlock.cpp:1.54 llvm/lib/VMCore/BasicBlock.cpp:1.55
--- llvm/lib/VMCore/BasicBlock.cpp:1.54	Sat Jan 29 18:08:49 2005
+++ llvm/lib/VMCore/BasicBlock.cpp	Wed Feb 23 01:09:08 2005
@@ -136,8 +136,10 @@
 // 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.






More information about the llvm-commits mailing list