fix two significant issues with FoldTwoEntryPHINode:
authorChris Lattner <sabre@nondot.org>
Tue, 14 Dec 2010 08:01:53 +0000 (08:01 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 14 Dec 2010 08:01:53 +0000 (08:01 +0000)
commit60d410d7bb2eb11f36a004237e5948ffc5aff5a6
tree41aa1ddee919eadb28ff342de596e69ebc5d22b3
parent071edc81f2a34ff689a2008e327ce7bce3a8edbf
fix two significant issues with FoldTwoEntryPHINode:

first, it can kick in on blocks whose conditions have been
folded to a constant, even though one of the edges will be
trivially folded.

second, it doesn't clean up the "if diamond" that it just
eliminated away.  This is a problem because other simplifycfg
xforms kick in depending on the order of block visitation,
causing pointless work.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121762 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Utils/SimplifyCFG.cpp
test/Transforms/SimplifyCFG/PhiBlockMerge.ll