diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-04-20 23:36:09 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-04-20 23:36:09 +0000 |
commit | d114da6004b6a3671a08427102fd95369de1e44b (patch) | |
tree | 62ef16f6cfc4428ece02517a9795c01c47cdb3b4 /llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | |
parent | f99295c3a684a4370a38074c62e352cf80e4e0b8 (diff) | |
download | bcm5719-llvm-d114da6004b6a3671a08427102fd95369de1e44b.tar.gz bcm5719-llvm-d114da6004b6a3671a08427102fd95369de1e44b.zip |
Fix PR12599.
The X86 target is editing the selection DAG while isel is selecting
nodes following a topological ordering. When the DAG hacking triggers
CSE, nodes can be deleted and bad things happen.
llvm-svn: 155257
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index e2735de5102..2c149da04f8 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -2776,9 +2776,14 @@ SelectCodeCommon(SDNode *NodeToMatch, const unsigned char *MatcherTable, (SDNode*) 0)); } - } else { + } else if (NodeToMatch->getOpcode() != ISD::DELETED_NODE) { Res = MorphNode(NodeToMatch, TargetOpc, VTList, Ops.data(), Ops.size(), EmitNodeInfo); + } else { + // NodeToMatch was eliminated by CSE when the target changed the DAG. + // We will visit the equivalent node later. + DEBUG(dbgs() << "Node was eliminated by CSE\n"); + return 0; } // If the node had chain/glue results, update our notion of the current |