[llvm] r271713 - Revert "SDAG: Update ChainNodesMatched as nodes are deleted"
Justin Bogner via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 3 12:40:06 PDT 2016
Author: bogner
Date: Fri Jun 3 14:40:06 2016
New Revision: 271713
URL: http://llvm.org/viewvc/llvm-project?rev=271713&view=rev
Log:
Revert "SDAG: Update ChainNodesMatched as nodes are deleted"
Seeing failures in CodeGen/Generic/icmp-illegal.ll on quite a few
bots.
This reverts r271706.
Modified:
llvm/trunk/include/llvm/CodeGen/SelectionDAG.h
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAG.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAG.h?rev=271713&r1=271712&r2=271713&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/SelectionDAG.h (original)
+++ llvm/trunk/include/llvm/CodeGen/SelectionDAG.h Fri Jun 3 14:40:06 2016
@@ -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
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=271713&r1=271712&r2=271713&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Fri Jun 3 14:40:06 2016
@@ -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(
} 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);
}
More information about the llvm-commits
mailing list