summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-04-29 16:20:25 +0000
committerChris Lattner <sabre@nondot.org>2002-04-29 16:20:25 +0000
commit2dfc667a7dad832f3a3cd65cc1daf7c5ec855699 (patch)
tree76b1a91e3b2f72b3a1bd3dee1cb5b62adce6a69a /llvm/lib
parent37104aace8a7f5ed8e11e905aeaf579b526e3b8e (diff)
downloadbcm5719-llvm-2dfc667a7dad832f3a3cd65cc1daf7c5ec855699.tar.gz
bcm5719-llvm-2dfc667a7dad832f3a3cd65cc1daf7c5ec855699.zip
Remove broken assertion.
llvm-svn: 2396
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/Scalar/GCSE.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Scalar/GCSE.cpp b/llvm/lib/Transforms/Scalar/GCSE.cpp
index cb24a0cbfc0..2676609141d 100644
--- a/llvm/lib/Transforms/Scalar/GCSE.cpp
+++ b/llvm/lib/Transforms/Scalar/GCSE.cpp
@@ -105,6 +105,8 @@ bool GCSE::runOnFunction(Function *F) {
//
void GCSE::ReplaceInstWithInst(Instruction *First, BasicBlock::iterator SI) {
Instruction *Second = *SI;
+
+ //cerr << "DEL " << (void*)Second << Second;
// Add the first instruction back to the worklist
WorkList.insert(First);
@@ -127,9 +129,9 @@ void GCSE::ReplaceInstWithInst(Instruction *First, BasicBlock::iterator SI) {
//
void GCSE::CommonSubExpressionFound(Instruction *I, Instruction *Other) {
// I has already been removed from the worklist, Other needs to be.
- assert(WorkList.count(I) == 0 && WorkList.count(Other) &&
- "I in worklist or Other not!");
- WorkList.erase(Other);
+ assert(I != Other && WorkList.count(I) == 0 && "I shouldn't be on worklist!");
+
+ WorkList.erase(Other); // Other may not actually be on the worklist anymore...
// Handle the easy case, where both instructions are in the same basic block
BasicBlock *BB1 = I->getParent(), *BB2 = Other->getParent();
OpenPOWER on IntegriCloud