diff options
author | Chris Lattner <sabre@nondot.org> | 2010-03-28 04:54:33 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-03-28 04:54:33 +0000 |
commit | 19e37cbf4fa202fc7ca1d769e5ce476f83290dd5 (patch) | |
tree | 3aa5013b348914c095c3b1dac882598d26a64150 /lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | |
parent | ec243474bc652de18eca62830b4bc12d35d52d9a (diff) |
don't add flag nodes with chain results to the NowDeadNodes
list multiple times when MorphNodeTo can't be applied.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99735 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 6c22262d8c..600557eddf 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -1614,8 +1614,9 @@ UpdateChainsAndFlags(SDNode *NodeToMatch, SDValue InputChain, CurDAG->ReplaceAllUsesOfValueWith(SDValue(FRN, FRN->getNumValues()-1), InputFlag, &ISU); - // If the node became dead, delete it. - if (FRN->use_empty()) + // If the node became dead and we haven't already seen it, delete it. + if (FRN->use_empty() && + !std::count(NowDeadNodes.begin(), NowDeadNodes.end(), FRN)) NowDeadNodes.push_back(FRN); } } |