commit | 6f279e0bda35a35740cc8c5479d579890bc1d3f7 | [log] [tgz] |
---|---|---|
author | Evan Cheng <evan.cheng@apple.com> | Fri Jan 08 02:36:12 2010 +0000 |
committer | Evan Cheng <evan.cheng@apple.com> | Fri Jan 08 02:36:12 2010 +0000 |
tree | 08d556290ff7debfe8c6104fd50dcb50927cb422 | |
parent | b093bd0565b1f5c93c2696f6ec712b2e61551c5b [diff] [blame] |
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
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 10dcc09..c87e4bf 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -459,7 +459,8 @@ 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; }