[SimplifyCFG] Followup fix to r280790
authorJames Molloy <james.molloy@arm.com>
Wed, 7 Sep 2016 09:01:22 +0000 (09:01 +0000)
committerJames Molloy <james.molloy@arm.com>
Wed, 7 Sep 2016 09:01:22 +0000 (09:01 +0000)
commit6c009c1c85e3de0e090ae31258d5d0bbd2a9f54d
treea1d9bf1ccd2e961676a5a6a94559a4f2b889df52
parent46031e6fecf334ebf0f867cc84430f1c927c7591
[SimplifyCFG] Followup fix to r280790

In failure cases it's not guaranteed that the PHI we're inspecting is actually in the successor block! In this case we need to bail out early, and never query getIncomingValueForBlock() as that will cause an assert.

llvm-svn: 280794
llvm/lib/Transforms/Utils/SimplifyCFG.cpp