select (X != 0), -1, Y --> 0 - X; or (sbb), Y
select (X != 0), Y, -1 --> X - 1; or (sbb), Y
We already had these x86 carry-flag transforms, but one was over-specified to handle a "0" select arm. That's just a special-case of the more general pattern (the 'or' will be deleted if Y is zero).
This is part of solving #53006, but it misses that example because some other combine has already converted that exact pattern into math ops.
Might be able to use X86ISD::SETCC_CARRY? Though SBB with identical source is only recognized as a special case on AMD CPUs last I knew.