If a chain of two selects share a true/false value and are controlled by two setcc nodes, that are never both true, we can fold away one of the selects. So, the following
(select (setcc X, const0, eq), Y, (select (setcc X, const1, eq), Z, Y))
Can be combined to:
select (setcc X, const1, eq) Z, Y
This is phrased as "same value" but I think the checks just check that they can't both be true at the same time. They could still both be false at the same time.