https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127538
--- Comment #9 from Drea Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Drea Pinski from comment #7)
> That is :
> ```
> Trying 33, 34 -> 35:
> 33: cc:CC=cmp(r102:DI,r103:DI)
> 34: r105:DI={(geu(cc:CC,0))?r103:DI:0}
> REG_DEAD r103:DI
> REG_DEAD cc:CC
> 35: r102:DI=r102:DI-r105:DI
> REG_DEAD r105:DI
> Failed to match this instruction:
> (set (reg/v:DI 102 [ xD.4508 ])
> (minus:DI (reg/v:DI 102 [ xD.4508 ])
> (if_then_else:DI (geu (reg/v:DI 102 [ xD.4508 ])
> (reg/v:DI 103 [ qD.4509 ]))
> (reg/v:DI 103 [ qD.4509 ])
> (const_int 0 [0]))))
> ```
> Being matched.
This is exactly how LLVM handles this case from the looks at their IR too. They
have a special case in their isel pass to detect cmp/csel/sub and rewrite it
into subs/csel.