(Cond0 s> -1) ? N1 : 0 --> ~(Cond0 s>> BW-1) & N1
https://alive2.llvm.org/ce/z/mGCBrd
This was suggested as a potential enhancement in D113212 (also 7e30404c3b6c ).
This looks like an improvement for AArch that could be generalized ( X > -1 --> X >= 0 ).
For x86, we have a counter-acting fold for most cases that turns the shift+not back into a setcc, so that needs a work-around to get more cases to use "pandn".
Notice the symmetry, there's final 4'th pattern there:
(Cond0 s> -1) ? -1 : N1 --> ~(Cond0 s>> BW-1) | N1
https://alive2.llvm.org/ce/z/ZefLue