[SimplifyCFG] Fix bootstrap failure after r280220
authorJames Molloy <james.molloy@arm.com>
Wed, 31 Aug 2016 12:33:48 +0000 (12:33 +0000)
committerJames Molloy <james.molloy@arm.com>
Wed, 31 Aug 2016 12:33:48 +0000 (12:33 +0000)
commitb7efa6c22777539be1e63a76988ed030cf264599
treee2024670b148e4a12721fcc3e6a38acdcf114f9f
parentf2392f69d5f135c97205b5ef5c3c4d68a95ccfa4
[SimplifyCFG] Fix bootstrap failure after r280220

We check that a sinking candidate is used by only one PHI node during our legality checks. However for instructions that are used by other sinking candidates our heuristic is less conservative. This can result in a candidate actually being illegal when we come to sink it because of how we sunk a predecessor. Do the used-by-only-one-PHI checks again during sinking to ensure we don't crash.

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