[LoopUnswitch] unswitch if cond is in select form of and/or as well
I'm trying to fix unsafe propagation of poison values in and/or conditions by using
equivalent select forms (select i1 A, i1 B, i1 false and select i1 A, i1 true, i1 false)
D93065 has links to patches for this.
This patch allows unswitch to happen if the condition is in this form as well.
collectHomogenousInstGraphLoopInvariants is updated to keep traversal if
Root and the visiting I matches both m_LogicalOr()/m_LogicalAnd().
Other than this, the remaining changes are almost straightforward and simply replaces
Instruction::And/Or check with match(m_LogicalOr()/m_LogicalAnd()).
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D97756