[SimplifyCFG] Check PHI uses more accurately
authorJames Molloy <james.molloy@arm.com>
Wed, 7 Sep 2016 08:15:54 +0000 (08:15 +0000)
committerJames Molloy <james.molloy@arm.com>
Wed, 7 Sep 2016 08:15:54 +0000 (08:15 +0000)
commitbf1837d9c9791a1c4e5b1f90a29ecc0f6c9333dc
treeaeca4307b916966a2ac6565fde48864c0c07bf76
parent42c83f131eff4046ba166b88959ae29ebce0c925
[SimplifyCFG] Check PHI uses more accurately

PR30292 showed a case where our PHI checking wasn't correct. We were checking that all values were used by the same PHI before deciding to sink, but we weren't checking that the incoming values for that PHI were what we expected. As a result, we had to bail out after block splitting which caused us to never reach a steady state in SimplifyCFG.

Fixes PR30292.

llvm-svn: 280790
llvm/lib/Transforms/Utils/SimplifyCFG.cpp
llvm/test/Transforms/SimplifyCFG/sink-common-code.ll