[InstCombine] avoid crash sinking to unreachable block
authorSanjay Patel <spatel@rotateright.com>
Thu, 10 Dec 2020 18:06:23 +0000 (13:06 -0500)
committerSanjay Patel <spatel@rotateright.com>
Thu, 10 Dec 2020 18:10:26 +0000 (13:10 -0500)
commit4f051fe37438632d10480c346520a0de624dbebf
tree5e25a5e93b6b76ee4ed5ff2c849f6cb69e27a36b
parent12b684ae02226f7785d3fb412fb155d4e15cc9bd
[InstCombine] avoid crash sinking to unreachable block

The test is reduced from the example in D82005.

Similar to 94f6d365e, the test here would assert in
the DomTree when we tried to convert a select to a
phi with an unreachable block operand.

We may want to add some kind of guard code in DomTree
itself to avoid this sort of problem.
llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
llvm/test/Transforms/InstCombine/phi-select-constant.ll