This is motivated by the example in https://llvm.org/PR50055 , but it doesn't do anything for that bug currently because we don't actually have a zero-extended setcc there. We'll need to do something else to see through to the ideal compare code on that one.
Proof for the generic transform (inverse of what we would try to do in combining):
https://alive2.llvm.org/ce/z/aBL-Mg
I think this could be a bit more readable if it specified the u/s of the comparison predicates.