Allowed folding for "and/or" binops with non-constant operand if
arguments of select are 0/-1 values.
Normally this code with "and" opcode does not get to a DAG combiner
and simplified yet in the InstCombine. However AMDGPU produces it
during lowering and InstCombine has no chance to optimize it out.
In turn the same pattern with "or" opcode can reach DAG.
This deserves an example in the comment since it doesn't match the formula below here.
Something like:
and (select Cond, 0, -1), X --> select Cond, 0, X
or X, (select Cond, -1, 0) --> select Cond, -1, X