Fix some bugs in SimplifyNodeWithTwoResults where it would call deletenode to
authorChris Lattner <sabre@nondot.org>
Sat, 26 Jan 2008 01:09:19 +0000 (01:09 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 26 Jan 2008 01:09:19 +0000 (01:09 +0000)
commit5eee427594c87a037a108047b3cd39c14f724752
tree7a5d62eac2a0a292784fc5d738aaff1ee206f391
parent9967c15183e023b7cf59b094d69530ffeca1aa0f
Fix some bugs in SimplifyNodeWithTwoResults where it would call deletenode to
delete a node even if it was not dead in some cases.  Instead, just add it to
the worklist.  Also, make sure to use the CombineTo methods, as it was doing
things that were unsafe: the top level combine loop could touch dangling memory.

This fixes CodeGen/Generic/2008-01-25-dag-combine-mul.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46384 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
test/CodeGen/Generic/2008-01-25-dag-combine-mul.ll [new file with mode: 0644]