[InstCombine] Replace selects with Phis
authorMax Kazantsev <mkazantsev@azul.com>
Tue, 23 Jun 2020 04:46:59 +0000 (11:46 +0700)
committerMax Kazantsev <mkazantsev@azul.com>
Tue, 23 Jun 2020 05:12:59 +0000 (12:12 +0700)
commit9bff376e5c10ea384a6eee93f7d7668d670a66e7
tree4f61de9bce7b186aa3092516b145f68a868f3e0b
parentb1360caa823d35ea3067eb6a1519014b4fd105eb
[InstCombine] Replace selects with Phis

We can sometimes replace a select with a Phi node if all of its values
are available on respective incoming edges.

Differential Revision: https://reviews.llvm.org/D82005
Reviewed By: nikic
llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
llvm/test/Transforms/InstCombine/select.ll