From a6822f64f333e7134670625b1bcfd2eebfd2faa6 Mon Sep 17 00:00:00 2001 From: Chad Rosier Date: Wed, 17 Aug 2016 14:31:34 +0000 Subject: Revert "[Reassociate] Avoid iterator invalidation when negating value." This reverts commit r278928 due to lit test failures. llvm-svn: 278929 --- llvm/lib/Transforms/Scalar/Reassociate.cpp | 9 --------- 1 file changed, 9 deletions(-) (limited to 'llvm/lib/Transforms/Scalar/Reassociate.cpp') diff --git a/llvm/lib/Transforms/Scalar/Reassociate.cpp b/llvm/lib/Transforms/Scalar/Reassociate.cpp index 5b3e7c50e50..b930a8fb7e9 100644 --- a/llvm/lib/Transforms/Scalar/Reassociate.cpp +++ b/llvm/lib/Transforms/Scalar/Reassociate.cpp @@ -842,13 +842,6 @@ static Value *NegateValue(Value *V, Instruction *BI, if (TheNeg->getParent()->getParent() != BI->getParent()->getParent()) continue; - // Don't move the negate if it's in the block we're currently optimizing as - // this may invalidate our iterator. - // FIXME: We should find a more robust solution as we're missing local CSE - // opportunities because of this constraint. - if (TheNeg->getParent() == BI->getParent()) - continue; - BasicBlock::iterator InsertPt; if (Instruction *InstInput = dyn_cast(V)) { if (InvokeInst *II = dyn_cast(InstInput)) { @@ -1870,8 +1863,6 @@ void ReassociatePass::RecursivelyEraseDeadInsts( /// Zap the given instruction, adding interesting operands to the work list. void ReassociatePass::EraseInst(Instruction *I) { assert(isInstructionTriviallyDead(I) && "Trivially dead instructions only!"); - DEBUG(dbgs() << "Erasing dead inst: "; I->dump()); - SmallVector Ops(I->op_begin(), I->op_end()); // Erase the dead instruction. ValueRankMap.erase(I); -- cgit v1.2.3