summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorJustin Bogner <mail@justinbogner.com>2016-06-03 19:40:06 +0000
committerJustin Bogner <mail@justinbogner.com>2016-06-03 19:40:06 +0000
commit737c136176bbfb6e42968da4f623a7e3d6ca12b3 (patch)
tree792d86b3b24f6e5f3851948c92c6f516d6602b1c /llvm
parentd311739a5f8c1b15e173e9065f557d32cb259444 (diff)
downloadbcm5719-llvm-737c136176bbfb6e42968da4f623a7e3d6ca12b3.tar.gz
bcm5719-llvm-737c136176bbfb6e42968da4f623a7e3d6ca12b3.zip
Revert "SDAG: Update ChainNodesMatched as nodes are deleted"
Seeing failures in CodeGen/Generic/icmp-illegal.ll on quite a few bots. This reverts r271706. llvm-svn: 271713
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/CodeGen/SelectionDAG.h8
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp13
2 files changed, 4 insertions, 17 deletions
diff --git a/llvm/include/llvm/CodeGen/SelectionDAG.h b/llvm/include/llvm/CodeGen/SelectionDAG.h
index 5b1f23eaa08..c318973324f 100644
--- a/llvm/include/llvm/CodeGen/SelectionDAG.h
+++ b/llvm/include/llvm/CodeGen/SelectionDAG.h
@@ -249,14 +249,6 @@ public:
virtual void NodeUpdated(SDNode *N);
};
- struct DAGNodeDeletedListener : public DAGUpdateListener {
- std::function<void(SDNode *, SDNode *)> Callback;
- DAGNodeDeletedListener(SelectionDAG &DAG,
- std::function<void(SDNode *, SDNode *)> Callback)
- : DAGUpdateListener(DAG), Callback(Callback) {}
- void NodeDeleted(SDNode *N, SDNode *E) override { Callback(N, E); }
- };
-
/// When true, additional steps are taken to
/// ensure that getConstant() and similar functions return DAG nodes that
/// have legal types. This is important after type legalization since
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index 20d500cf20e..359919e14b2 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -2163,8 +2163,10 @@ void SelectionDAGISel::UpdateChains(
// Replace all the chain results with the final chain we ended up with.
for (unsigned i = 0, e = ChainNodesMatched.size(); i != e; ++i) {
SDNode *ChainNode = ChainNodesMatched[i];
- assert(ChainNode->getOpcode() != ISD::DELETED_NODE &&
- "Deleted node left in chain");
+
+ // If this node was already deleted, don't look at it.
+ if (ChainNode->getOpcode() == ISD::DELETED_NODE)
+ continue;
// Don't replace the results of the root node if we're doing a
// MorphNodeTo.
@@ -3366,13 +3368,6 @@ void SelectionDAGISel::SelectCodeCommon(SDNode *NodeToMatch,
} else {
assert(NodeToMatch->getOpcode() != ISD::DELETED_NODE &&
"NodeToMatch was removed partway through selection");
- SelectionDAG::DAGNodeDeletedListener NDL(*CurDAG, [&](SDNode *N,
- SDNode *E) {
- assert(!E && "Unexpected node replacement in MorphNode");
- ChainNodesMatched.erase(std::remove(ChainNodesMatched.begin(),
- ChainNodesMatched.end(), N),
- ChainNodesMatched.end());
- });
Res = MorphNode(NodeToMatch, TargetOpc, VTList, Ops, EmitNodeInfo);
}
OpenPOWER on IntegriCloud