From 9b7fdc7e8af26b65c9afdee45d4ec0b22c8a17c8 Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Tue, 2 Aug 2011 02:23:42 +0000 Subject: Revert r136503 and r136480 in an effort to fix non-determinism in the llvm-gcc buildbots on i386. Devang is looking into the root cause. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136674 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/Reassociate.cpp | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'lib/Transforms/Scalar/Reassociate.cpp') diff --git a/lib/Transforms/Scalar/Reassociate.cpp b/lib/Transforms/Scalar/Reassociate.cpp index 1080b75ed0..e6341ae307 100644 --- a/lib/Transforms/Scalar/Reassociate.cpp +++ b/lib/Transforms/Scalar/Reassociate.cpp @@ -75,7 +75,6 @@ namespace { class Reassociate : public FunctionPass { DenseMap RankMap; DenseMap, unsigned> ValueRankMap; - DenseMap DbgValues; SmallVector RedoInsts; SmallVector DeadInsts; bool MadeChange; @@ -105,9 +104,6 @@ namespace { void ReassociateInst(BasicBlock::iterator &BBI); void RemoveDeadBinaryOp(Value *V); - - /// collectDbgValues - Collect all llvm.dbg.value intrinsics. - void collectDbgValues(Function &F); }; } @@ -348,11 +344,6 @@ void Reassociate::LinearizeExprTree(BinaryOperator *I, void Reassociate::RewriteExprTree(BinaryOperator *I, SmallVectorImpl &Ops, unsigned i) { - // If this operation was representing debug info of a value then it - // is no longer true, so remove the dbg.value instrinsic. - if (DbgValueInst *DVI = DbgValues.lookup(I)) - DeadInsts.push_back(DVI); - if (i+2 == Ops.size()) { if (I->getOperand(0) != Ops[i].Op || I->getOperand(1) != Ops[i+1].Op) { @@ -1103,7 +1094,6 @@ Value *Reassociate::ReassociateExpression(BinaryOperator *I) { bool Reassociate::runOnFunction(Function &F) { - collectDbgValues(F); // Recalculate the rank map for F BuildRankMap(F); @@ -1123,22 +1113,11 @@ bool Reassociate::runOnFunction(Function &F) { // Now that we're done, delete any instructions which are no longer used. while (!DeadInsts.empty()) if (Value *V = DeadInsts.pop_back_val()) - if (!RecursivelyDeleteTriviallyDeadInstructions(V)) - if (DbgValueInst *DVI = dyn_cast(V)) - DVI->eraseFromParent(); + RecursivelyDeleteTriviallyDeadInstructions(V); // We are done with the rank map. RankMap.clear(); ValueRankMap.clear(); - DbgValues.clear(); return MadeChange; } -/// collectDbgValues - Collect all llvm.dbg.value intrinsics. -void Reassociate::collectDbgValues(Function &F) { - for (Function::iterator FI = F.begin(), FE = F.end(); FI != FE; ++FI) - for (BasicBlock::iterator BI = FI->begin(), BE = FI->end(); - BI != BE; ++BI) - if (DbgValueInst *DVI = dyn_cast(BI)) - DbgValues[DVI->getValue()] = DVI; -} -- cgit v1.2.3