[SimplifyCFG] Check PHI uses more accurately
commit40fa86fff8ccb2931a20ebad47128cf052403d1b
authorJames Molloy <james.molloy@arm.com>
Wed, 7 Sep 2016 08:15:54 +0000 (7 08:15 +0000)
committerJames Molloy <james.molloy@arm.com>
Wed, 7 Sep 2016 08:15:54 +0000 (7 08:15 +0000)
tree194500d529042fadb16e6d13cfcf5183bd8847cc
parent21c68fac744d155991eb02bfa6c3d5f75a33d51a
[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.

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