summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-03-28 04:54:33 +0000
committerChris Lattner <sabre@nondot.org>2010-03-28 04:54:33 +0000
commit7aed1fb69d33ffc7b9da09b84deedb19d5fcd41a (patch)
tree3a167fe3f292ab43a84c1388fee3d93a22867dde
parentd5cb1ddb2cf4347f8415149702fdadaa5a638c31 (diff)
downloadbcm5719-llvm-7aed1fb69d33ffc7b9da09b84deedb19d5fcd41a.tar.gz
bcm5719-llvm-7aed1fb69d33ffc7b9da09b84deedb19d5fcd41a.zip
don't add flag nodes with chain results to the NowDeadNodes
list multiple times when MorphNodeTo can't be applied. llvm-svn: 99735
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index 6c22262d8c5..600557eddfd 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/llvm/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);
}
}
OpenPOWER on IntegriCloud