https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123312
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Here is my plan for this one. In noce_try_cond_zero_arith (maybe changing the name to in noce_try_cond_arith; still thinking about that) and if this is an AND. After the noce_emit_cmove for `cmp?0:b` sequence, try to do `cmp?b:-1` via noce_emit_cmove (or is it `cmp?-1:b`), if that works, then compare the sequences cost. If the sequences are equal prefer the -1 as it is only one instruction afterwards. Then emit the AND (for the -1 case) or the AND/IOR (for the 0 case).
