If the phi node was used by an unreachable instruction that ends up using
authorDuncan Sands <baldrick@free.fr>
Mon, 21 Feb 2011 17:32:05 +0000 (17:32 +0000)
committerDuncan Sands <baldrick@free.fr>
Mon, 21 Feb 2011 17:32:05 +0000 (17:32 +0000)
commit2cfbf018a938d14126b9cb10c600e025f9831d2d
tree7336219a84ca3caedf532a93a353c4474c2b8ffb
parent6ad82d81cc3061a000799ad8751f018c1301906b
If the phi node was used by an unreachable instruction that ends up using
itself without going via a phi node then we could return false here in
spite of making a change.  Also, tweak the comment because this method
can (and always could) return true without deleting the original phi node.
For example, if the phi node was used by a read-only invoke instruction
which is used by another phi node phi2 which is only used by and only uses
the invoke, then phi2 would be deleted but not the invoke instruction and
not the original phi node.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126129 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Transforms/Utils/Local.h
lib/Transforms/Utils/Local.cpp