summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2014-07-21 08:32:31 +0000
committerChandler Carruth <chandlerc@gmail.com>2014-07-21 08:32:31 +0000
commit24ceb0ce660baeee875cd560480288b65c2ba133 (patch)
tree80a50790f5b0a41764f844875d6335a8f487734c /llvm/lib
parent0fb2013192e23a8f5a46c752a21fd9282737e4af (diff)
downloadbcm5719-llvm-24ceb0ce660baeee875cd560480288b65c2ba133.tar.gz
bcm5719-llvm-24ceb0ce660baeee875cd560480288b65c2ba133.zip
[SDAG] Rather than using a narrow test against the one dummy node on the
stack, filter all handle nodes from the DAG combiner worklist. This will also handle cases where other handle nodes might be (erroneously) added to the worklist and then cause bugs and explosions when deleted. For example, when running the legalizer within the DAG combiner, there are times when other handle nodes are used and can end up here. llvm-svn: 213505
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 2bed93b0dff..c3020f81734 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -127,6 +127,11 @@ namespace {
/// AddToWorkList - Add to the work list making sure its instance is at the
/// back (next to be processed.)
void AddToWorkList(SDNode *N) {
+ // Skip handle nodes as they can't usefully be combined and confuse the
+ // zero-use deletion strategy.
+ if (N->getOpcode() == ISD::HANDLENODE)
+ return;
+
WorkListContents.insert(N);
WorkListOrder.push_back(N);
}
@@ -1108,7 +1113,7 @@ void DAGCombiner::Run(CombineLevel AtLevel) {
// If N has no uses, it is dead. Make sure to revisit all N's operands once
// N is deleted from the DAG, since they too may now be dead or may have a
// reduced number of uses, allowing other xforms.
- if (N->use_empty() && N != &Dummy) {
+ if (N->use_empty()) {
for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i)
AddToWorkList(N->getOperand(i).getNode());
OpenPOWER on IntegriCloud