summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG
diff options
context:
space:
mode:
authorNirav Dave <niravd@google.com>2017-05-16 15:49:02 +0000
committerNirav Dave <niravd@google.com>2017-05-16 15:49:02 +0000
commitcfd357a61a96b83356db0b5b3021ce60eaf1f1cb (patch)
treebf06f10827bccec83713615717d2b83dcb1f036e /llvm/lib/CodeGen/SelectionDAG
parente133140fd1e5ea3a5bcadc3e594e1b613c36d9c5 (diff)
downloadbcm5719-llvm-cfd357a61a96b83356db0b5b3021ce60eaf1f1cb.tar.gz
bcm5719-llvm-cfd357a61a96b83356db0b5b3021ce60eaf1f1cb.zip
[DAG] Prune deleted nodes in TokenFactor
Fix visitTokenFactor to correctly remove deleted nodes. NFC. llvm-svn: 303181
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index fb8c50a4d69..caf5cb497a7 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -1729,10 +1729,9 @@ SDValue DAGCombiner::visitTokenFactor(SDNode *N) {
NumLeftToConsider--;
}
- SDValue Result;
-
// If we've changed things around then replace token factor.
if (Changed) {
+ SDValue Result;
if (Ops.empty()) {
// The entry token is the only possible outcome.
Result = DAG.getEntryNode();
@@ -1749,13 +1748,9 @@ SDValue DAGCombiner::visitTokenFactor(SDNode *N) {
Result = DAG.getNode(ISD::TokenFactor, SDLoc(N), MVT::Other, Ops);
}
}
-
- // Add users to worklist, since we may introduce a lot of new
- // chained token factors while removing memory deps.
- return CombineTo(N, Result, true /*add to worklist*/);
+ return Result;
}
-
- return Result;
+ return SDValue();
}
/// MERGE_VALUES can always be eliminated.
OpenPOWER on IntegriCloud