OSDN Git Service

Fix SelectionDAG::ReplaceAllUsesWith to behave correctly when
authorDan Gohman <gohman@apple.com>
Mon, 19 Jan 2009 21:44:21 +0000 (21:44 +0000)
committerDan Gohman <gohman@apple.com>
Mon, 19 Jan 2009 21:44:21 +0000 (21:44 +0000)
commitdbe664adcddd8610952968d86791478c874cf1cd
tree5d0f6b564ca7fc6a240dde912ad6e20b096def3f
parent2c7ed11d93239dacf81540e2307f0db456bb9122
Fix SelectionDAG::ReplaceAllUsesWith to behave correctly when
uses are added to the From node while it is processing From's
use list, because of automatic local CSE. The fix is to avoid
visiting any new uses.

Fix a few places in the DAGCombiner that assumed that after
a RAUW call, the From node has no users and may be deleted.

This fixes PR3018.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62533 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
lib/CodeGen/SelectionDAG/SelectionDAG.cpp
test/CodeGen/X86/pr3018.ll [new file with mode: 0644]