summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-01-24 07:18:21 +0000
committerChris Lattner <sabre@nondot.org>2008-01-24 07:18:21 +0000
commitd66eac62fda5f83ef7d3f2b4339873defe353327 (patch)
tree4ea3b37b1509273f59e194fc02910621d91a8805 /llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
parent0feb1b0f847c420a64f2ef37a72d1823f8c42305 (diff)
downloadbcm5719-llvm-d66eac62fda5f83ef7d3f2b4339873defe353327.tar.gz
bcm5719-llvm-d66eac62fda5f83ef7d3f2b4339873defe353327.zip
The dag combiner is missing revisiting nodes that it really should, and thus leaving
dead stuff around. This gets fed into the isel pass and causes certain foldings from happening because nodes have extraneous uses floating around. For example, if we turned foo(bar(x)) -> baz(x), we sometimes left bar(x) around. llvm-svn: 46305
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 5ebda953fbd..788c8c04a82 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -606,6 +606,11 @@ void DAGCombiner::Run(bool RunningAfterLegalize) {
// Push the new node and any users onto the worklist
AddToWorkList(RV.Val);
AddUsersToWorkList(RV.Val);
+
+ // Add any uses of the old node to the worklist if they have a single
+ // use. They may be dead after this node is deleted.
+ for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i)
+ AddToWorkList(N->getOperand(i).Val);
// Nodes can be reintroduced into the worklist. Make sure we do not
// process a node that has been replaced.
OpenPOWER on IntegriCloud