<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/54283>54283</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [AArch64] fold shift into cmp
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

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

<pre>
    ```
define @high_mask1(i64 %x) {
  %r = icmp ugt i64 %x, 8191
  ret i1 %r
}

define i1 @high_mask2(i32 %0) {
  %r = icmp ugt i32 %x, 8191
  ret i1 %r
}
```

These become a shift and compare with zero, but those could be combined into "cmp xzr, x0, lsr 13":
https://godbolt.org/z/Pjeq7TshY
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyVUsFu3CAQ_Rp8GWWFwXjtgw-bWj33kEtPFdjYkLJmA7jZ7td3sDdK2ksVCWNm5s289wTKj787UtP7oj2hp1FPdtFAKmrsbH6cZfxZEtbYugLCxJWwFsjxccdCTgUgvAc7nC-wzgnegV-gKdvyDRk01sqtYU-RY38_fOTNkA_ULFNzltvo_6l34Geo__a-709GRw1KD_6sQUI0dkoglxEwcZFBw6tNBm46-Eyk1gTJeOwY_OpG7Ms4hV5GsEvySMuywOstZPiV5t3FACXHCuF3UpPSJeaIfcU1-1F5lw4-zBjd8Pv2rF-OT9F8L8aOjy1vZZFscroj4vF0CoOpKyJ6mDxK2BVv5MhcrMF1_4xHA6s6oE4MnPv19nu4BP-sh4ShjXHVEQ-iYg0vTEeVoLRWddOKgVdVKyUb-NQIcWwrrcZj4aTSLmY96GvRr7CNyB5FX9iOUcYopw3DKbw5DLSiqhQNb6ga2DThpeuztO6QdWTfReg2SWqdIxadjSm-F2WMdl70Zj_PlyveQeiCTzLpgK8nFRt9t8n_A_g_2OQ">