diff options
| author | Chris Lattner <sabre@nondot.org> | 2008-01-24 07:18:21 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2008-01-24 07:18:21 +0000 |
| commit | 20e3d86766a38492b3f6203bf4cf70dd9d187b7b (patch) | |
| tree | 5f8aad7af3b00ec16572d7998ea66b3d13b7d68e /lib | |
| parent | 0aa5e6f3fbde81c0bf0310ab0582420f0eeb7155 (diff) | |
| download | external_llvm-20e3d86766a38492b3f6203bf4cf70dd9d187b7b.zip external_llvm-20e3d86766a38492b3f6203bf4cf70dd9d187b7b.tar.gz external_llvm-20e3d86766a38492b3f6203bf4cf70dd9d187b7b.tar.bz2 | |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46305 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 5ebda95..788c8c0 100644 --- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/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. |
