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 | 0b35c35efcc584c0a09ed70840bcca420f42be2f (patch) | |
| tree | 809c1418d7fa7d0f96327204ee024b7601e204b6 /lib | |
| parent | d83c9ea7d10d8ea5ca8b6cb8a5227b747c505afc (diff) | |
| download | external_llvm-0b35c35efcc584c0a09ed70840bcca420f42be2f.zip external_llvm-0b35c35efcc584c0a09ed70840bcca420f42be2f.tar.gz external_llvm-0b35c35efcc584c0a09ed70840bcca420f42be2f.tar.bz2 | |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155257 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index e2735de..2c149da 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/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 |
