Currently foldSelectOpOp only optimises selects where the operands have only one use, in order to avoid a proliferation of select instructions. If we can reuse an existing select then we can relax this constraint.
This kind of pattern can happen when GVN PRE phi translation introduces a phi then later both of the phis become selects.