<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=http://email.email.llvm.org/c/eJylVE1zmzAQ_TXiookHhInNgYNTt5dOp5feM_oC1ApEJNFi__quhGliEredCSMjr3b3vbfaYZkRp-pbqxwOqxu07GTvqVemx6bGWjp351saDTJhdJ-q-y28cTdqr-4GK7lyIVj1XjbSYmF6idkJ81byH6pvsG8l5tTaE641bXBtTYfdyLylPLBsUHpE6aH1fnAoPyDyCVZjBDPab4xtwDrD7zNr-6c9L7M5HBTMS-uf3XwkZK2AWmUYbVMgiJyPoPKRTCCZ7EE4RqSYUkQ-4MXIXhinl54TeErcm7H_pXqB0e5hpsHByVKM8iNWvBswMOAr6BnpOVhkMRgkXbPOJC9Asxuob0en5xh9lpOPRUdV3oSsK9DsTVCxgALOVXiMNnaBzJaSAGiJs_IP49KO3XHVl4sZ319HP4w-NPc6hrpL6153a4nFl2cCReGRdAp6wnblD9WFxwoV_Fas_E56FnaqV-cjm_PcnMdv5HF9g--St9Zzi-9SRjiHtDUqXOxfrvHjNEjupXjXRf7zotj_Xci6MJD-tFKViCoXZV7ShI6-NbbibU2dT0arq9Xnrnw7sg03HRjxi543GC_mO9QMpnJulA7-FPk2J0lb7YqSl8Wu3PNtKsWOZ1uRlbttXnC6r0vBE02Z1K5CxQMiJILmBzN41alzHG8ARlBxTN4vRlUkJSTNyD3Js5yUG5mTjLOsLiWp67IoYSDJjiq9CThhqCW2ipBsbBw4tXLePTupc6rppYzaQaFXXsvqC7BKgUEXU30YrDCRR2i4QeQhdBUGsAntS6K6Kkr7DXuYohY>53432</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Missed combining of usubo+cmp into sbb
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            llvm:optimizations
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          chfast
      </td>
    </tr>
</table>

<pre>
    This is implementation of less-than of 2x `i64` multi-precision integer done by checking the carry flag from subtraction.
https://godbolt.org/z/Kbhnq8c91
```llvm
define i1 @subcarry_ult_2x64(i64 %x0, i64 %x1, i64 %y0, i64 %y1) nounwind {
  %b0 = icmp ult i64 %x0, %y0
  %d1 = sub i64 %x1, %y1
  %b10 = icmp ult i64 %x1, %y1
  %b0z = zext i1 %b0 to i64
  %b11 = icmp ult i64 %d1, %b0z
  %b1 = or i1 %b10, %b11
  ret i1 %b1
}
```

Output:
```asm
subcarry_ult_2x64:
        xor     eax, eax
        cmp     rdi, rdx
        setb    al
        sub     rsi, rcx
        setb    cl
        cmp     rsi, rax
        setb    al
        or      al, cl
        ret
```

Expected:
```asm
subcarry_ult_2x64:
        cmp     rdi, rdx
        sbb     rsi, rcx
        setb    al
        retq
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJylVMGOmzAQ_Rq4WBuBCUk4cMg27aWqeul9ZZsB3BrM2qYl-fqOTehu6KatVOTgjGfmvTdjMVxX5_JLKy3xqxsUdNA75qTuia6JAmsfXMuCQScS7RK52-KbdKNy8mEwIKT1wbJ30IAhle6B8DMRLYhvsm-Ia4EIZsyZ1Io1pDa6I3bkzjDhWTZRcoqSY-vcYKPsGNEPuBpdca3cRpsGrQv-PvK2fz6IIp3DUcG8lPrezUcV1BKpZUqibYIEgfMJVT7RCSXTAwonEc2nJKLvyGKkr4zza88ZPQXp9dj_kH1Fov3jTEO8kyckyk5Eim4gyEBuoGekl-AqDcEo6ZZ1JnkFmt5BfTs6uYToC0wuFB1UOe2zbkDTN0GrBRRxbsJDtDYLZLqUhEBLnIFfjMt17E-re7ma4f15dMPo_OXexjB7vbrfb2uJJddnQkX-ATZ5PX678fvq_GMq6f2mWvktOO53plbnI5_z7Jwn7uQJdYfvmrfWc4_vWoY_x7Q1Kjb2D218Pw0gHFT_1ci_Nor_W0PWhaH055WquCqzqsgKFjvpFJSfpLVQEaE7Lns_GXCkjKhYR_TRy8IJoj1_PBpVruaBdO3IN5iKRvjk5w3nj_6KTUETwUew-CfPthmN2zIX6Q7yGg6J4PuEFvu8Thgt8sM25RwONFaMg7JllD9GlAbQ7KgHJzt5CfMPwWiUn2JZ0oTSJKU7mqUZLTaQ0VTwtC6A1nWRFzhvoGNSbTyIn1mxKYM6PjYWnUpaZ1-czFrZ9ACBGfHZ6FptStHWzLo41FGGIn4CxsqMjA">