aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2008-06-30 16:43:45 +0000
committerDuncan Sands <baldrick@free.fr>2008-06-30 16:43:45 +0000
commit6f7e1cddf63f91af84996d59cdb5809088ac3fe3 (patch)
treeae757b702a486998bc314bb317b3c120d08a7b95 /lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
parentd3ca9fc9984d036146886a40ad3f73aaf7a424eb (diff)
ExpungeNode is only needed for new nodes! This
fixes CodeGen/PowerPC/2008-06-19-LegalizerCrash.ll when using the new LegalizeTypes infrastructure. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52903 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/LegalizeTypes.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/LegalizeTypes.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp b/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
index 0c50d64d4e..00f3201742 100644
--- a/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
+++ b/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
@@ -364,16 +364,19 @@ void DAGTypeLegalizer::RemapNode(SDOperand &N) {
}
}
-/// ExpungeNode - If this is a deleted value that was kept around to speed up
-/// remapping, remove it globally now. The only map that can have a deleted
-/// node as a source is ReplacedNodes. Other maps can have deleted nodes as
-/// targets, but since their looked-up values are always immediately remapped
-/// using RemapNode, resulting in a not-deleted node, this is harmless as long
-/// as ReplacedNodes/RemapNode always performs correct mappings. The mapping
-/// will always be correct as long as ExpungeNode is called on the source when
-/// adding a new node to ReplacedNodes, and called on the target when adding
-/// a new node to any map.
+/// ExpungeNode - If this is a reincarnation of a deleted value that was kept
+/// around to speed up remapping, remove it from all maps now. The only map
+/// that can have a deleted node as a source is ReplacedNodes. Other maps can
+/// have deleted nodes as targets, but since their looked-up values are always
+/// immediately remapped using RemapNode, resulting in a not-deleted node, this
+/// is harmless as long as ReplacedNodes/RemapNode always performs correct
+/// mappings. The mapping will always be correct as long as ExpungeNode is
+/// called on the source when adding a new node to ReplacedNodes, and called on
+/// the target when adding a new node to any map.
void DAGTypeLegalizer::ExpungeNode(SDOperand N) {
+ if (N.Val->getNodeId() != NewNode)
+ return;
+
SDOperand Replacement = N;
RemapNode(Replacement);
if (Replacement != N) {