This implements the following combines:
icmp ne ([sz]ext (icmp cc, x, y)), 0) -> icmp cc, x, y icmp eq, ([sz]ext (icmp cc x, y)), 0) -> icmp inv(cc), x, y icmp ne, (zext (icmp cc, x, y)), 1) -> icmp inv(cc), x, y icmp eq, (zext (icmp cc, x, y)), 1) -> icmp cc, x, y icmp ne, (sext (icmp cc, x, y)), -1) -> icmp inv(cc), x, y icmp eq, (sext (icmp cc, x, y)), -1) -> icmp cc, x, y
This is similar to a combine in TargetLowering::SimplifySetCC.
IR example: https://godbolt.org/z/qzx81v
BuildFnTy already exists