aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2010-01-08 02:36:12 +0000
committerEvan Cheng <evan.cheng@apple.com>2010-01-08 02:36:12 +0000
commit6f279e0bda35a35740cc8c5479d579890bc1d3f7 (patch)
tree08d556290ff7debfe8c6104fd50dcb50927cb422 /lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
parentb093bd0565b1f5c93c2696f6ec712b2e61551c5b (diff)
ReplaceAllUsesOfValueWith may delete other nodes that the one being replaced. Do not delete dead nodes again.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92988 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index 10dcc09c8e..c87e4bf716 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -459,7 +459,8 @@ void SelectionDAGISel::ShrinkDemandedOps() {
SDNode *N = Worklist.pop_back_val();
if (N->use_empty() && N != CurDAG->getRoot().getNode()) {
- CurDAG->DeleteNode(N);
+ if (N->getOpcode() != ISD::DELETED_NODE)
+ CurDAG->DeleteNode(N);
continue;
}