summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2008-06-11 11:42:12 +0000
committerDuncan Sands <baldrick@free.fr>2008-06-11 11:42:12 +0000
commitbf17080ec2b3e02c137df31fb486cb160ef01e94 (patch)
treef3ad3daaadaee8caa6fe7a5e77555af614a00721 /llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
parenta2fef0c117545092e6d1c7a47b814509b767c112 (diff)
downloadbcm5719-llvm-bf17080ec2b3e02c137df31fb486cb160ef01e94.tar.gz
bcm5719-llvm-bf17080ec2b3e02c137df31fb486cb160ef01e94.zip
Sometimes (rarely) nodes held in LegalizeTypes
maps can be deleted. This happens when RAUW replaces a node N with another equivalent node E, deleting the first node. Solve this by adding (N, E) to ReplacedNodes, which is already used to remap nodes to replacements. This means that deleted nodes are being allowed in maps, which can be delicate: the memory may be reused for a new node which might get confused with the old deleted node pointer hanging around in the maps, so detect this and flush out maps if it occurs (ExpungeNode). The expunging operation is expensive, however it never occurs during a llvm-gcc bootstrap or anywhere in the nightly testsuite. It occurs three times in "make check": Alpha/illegal-element-type.ll, PowerPC/illegal-element-type.ll and X86/mmx-shift.ll. If expunging proves to be too expensive then there are other more complicated ways of solving the problem. In the normal case this patch adds the overhead of a few more map lookups, which is hopefully negligable. llvm-svn: 52214
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 8696bcf63b9..0997840d852 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -272,7 +272,7 @@ class VISIBILITY_HIDDEN WorkListRemover :
public:
explicit WorkListRemover(DAGCombiner &dc) : DC(dc) {}
- virtual void NodeDeleted(SDNode *N) {
+ virtual void NodeDeleted(SDNode *N, SDNode *E) {
DC.removeFromWorkList(N);
}
OpenPOWER on IntegriCloud