From: Chris Lattner Date: Fri, 25 Jan 2008 23:34:24 +0000 (+0000) Subject: reduce indentation X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=50d8e491a2c044efb9f7b5c0c223d29ea2dbf6cd;p=oota-llvm.git reduce indentation git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46377 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 57e7a04d2ff..6510a0f70d7 100644 --- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -582,49 +582,51 @@ void DAGCombiner::Run(bool RunningAfterLegalize) { SDOperand RV = combine(N); - if (RV.Val) { - ++NodesCombined; - // If we get back the same node we passed in, rather than a new node or - // zero, we know that the node must have defined multiple values and - // CombineTo was used. Since CombineTo takes care of the worklist - // mechanics for us, we have no work to do in this case. - if (RV.Val != N) { - assert(N->getOpcode() != ISD::DELETED_NODE && - RV.Val->getOpcode() != ISD::DELETED_NODE && - "Node was deleted but visit returned new node!"); - - DOUT << "\nReplacing.3 "; DEBUG(N->dump(&DAG)); - DOUT << "\nWith: "; DEBUG(RV.Val->dump(&DAG)); - DOUT << '\n'; - std::vector NowDead; - if (N->getNumValues() == RV.Val->getNumValues()) - DAG.ReplaceAllUsesWith(N, RV.Val, &NowDead); - else { - assert(N->getValueType(0) == RV.getValueType() && "Type mismatch"); - SDOperand OpV = RV; - DAG.ReplaceAllUsesWith(N, &OpV, &NowDead); - } - - // Push the new node and any users onto the worklist - AddToWorkList(RV.Val); - AddUsersToWorkList(RV.Val); - - // Add any uses of the old node to the worklist in case this node is the - // last one that uses them. They may become dead after this node is - // deleted. - for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i) - AddToWorkList(N->getOperand(i).Val); - - // Nodes can be reintroduced into the worklist. Make sure we do not - // process a node that has been replaced. - removeFromWorkList(N); - for (unsigned i = 0, e = NowDead.size(); i != e; ++i) - removeFromWorkList(NowDead[i]); - - // Finally, since the node is now dead, remove it from the graph. - DAG.DeleteNode(N); - } + if (RV.Val == 0) + continue; + + ++NodesCombined; + // If we get back the same node we passed in, rather than a new node or + // zero, we know that the node must have defined multiple values and + // CombineTo was used. Since CombineTo takes care of the worklist + // mechanics for us, we have no work to do in this case. + if (RV.Val == N) + continue; + + assert(N->getOpcode() != ISD::DELETED_NODE && + RV.Val->getOpcode() != ISD::DELETED_NODE && + "Node was deleted but visit returned new node!"); + + DOUT << "\nReplacing.3 "; DEBUG(N->dump(&DAG)); + DOUT << "\nWith: "; DEBUG(RV.Val->dump(&DAG)); + DOUT << '\n'; + std::vector NowDead; + if (N->getNumValues() == RV.Val->getNumValues()) + DAG.ReplaceAllUsesWith(N, RV.Val, &NowDead); + else { + assert(N->getValueType(0) == RV.getValueType() && "Type mismatch"); + SDOperand OpV = RV; + DAG.ReplaceAllUsesWith(N, &OpV, &NowDead); } + + // Push the new node and any users onto the worklist + AddToWorkList(RV.Val); + AddUsersToWorkList(RV.Val); + + // Add any uses of the old node to the worklist in case this node is the + // last one that uses them. They may become dead after this node is + // deleted. + for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i) + AddToWorkList(N->getOperand(i).Val); + + // Nodes can be reintroduced into the worklist. Make sure we do not + // process a node that has been replaced. + removeFromWorkList(N); + for (unsigned i = 0, e = NowDead.size(); i != e; ++i) + removeFromWorkList(NowDead[i]); + + // Finally, since the node is now dead, remove it from the graph. + DAG.DeleteNode(N); } // If the root changed (e.g. it was a dead load, update the root).