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

    <tr>
        <th>Summary</th>
        <td>
            [AArch64] can use XAR for vector rotates where possible
        </td>
    </tr>

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

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

    <tr>
      <th>Reporter</th>
      <td>
          k-arrows
      </td>
    </tr>
</table>

<pre>
    Here is the code from gcc testsuite.
https://godbolt.org/z/fejTchexj
```c
typedef char __attribute__ ((vector_size (16))) v16qi;
typedef unsigned short __attribute__ ((vector_size (16))) v8hi;
typedef unsigned int __attribute__ ((vector_size (16))) v4si;
typedef unsigned long long __attribute__ ((vector_size (16))) v2di;
typedef char __attribute__ ((vector_size (8))) v8qi;
typedef unsigned short __attribute__ ((vector_size (8))) v4hi;
typedef unsigned int __attribute__ ((vector_size (8))) v2si;

v2di
G1 (v2di r) {
    return (r >> 39) | (r << 25);
}

v4si
G2 (v4si r) {
    return (r >> 23) | (r << 9);
}

v8hi
G3 (v8hi r) {
    return (r >> 5) | (r << 11);
}

v16qi
G4 (v16qi r)
{
  return (r << 2) | (r >> 6);
}

v2si
G5 (v2si r) {
    return (r >> 22) | (r << 10);
}

v4hi
G6 (v4hi r) {
    return (r >> 7) | (r << 9);
}

v8qi
G7 (v8qi r)
{
  return (r << 3) | (r >> 5);
}
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyklM1u4yAQgJ8GX0aNYMB2fPDB_Un2vNrD3iL_TGK6TsgCTrd9-hWm3U2jVHJVCdkCxh_MB57aOb07EJUsvWXpfVKPvje2_HVTW2ueXNKY7rn8RpZAO_A9QWs6gq01e9i1LXhy3o3a04Lxqvf-6JisGK4Yrnama8zgF8buGK5eGK629Pij7enPI-MVy3hsLeOVfz5SR1to-9rCZlN7b3UzetpsgOGS4fJErTd24_QLhRGRMSxig5PIfmsmb88w42HKqQPXG-s_DVz2H_H04fM05T6iDeawi4_PMrG7YM4VtzxP8-vaznHqq9bOYfgmjfFqypZXaxGCQgdsiGF5mAcAsORHewizFph8YPIBZBFD7t5G75i8A0wDP3Lz-1d6OB9erXGiKzeHjvIavbgCD1eJV2s5wZf9HHh6jS3EFfh08Xm1VhM99Cb8FBMXeI-PDi7w05rZFTpGL2m0Ps_LJTzunV-zHsVk0fosMfls6VFLHqXPsnJ5oP9O4h37rWQlXSm7QhZ1QqXIVaqKVGQq6UspVC2WlKddoxpZFxmpYim3lKm0zZHyRJfIMeUKlRAq42pBzVaRkCkWddPJomGK077Ww2IYTvtQOhPt3EilkLnIMBnqhgY31WrEAz3BNMsQQ-m2Zfjophl3jik-aOfdf4zXfpiKfFXZts8US--hrQ8wOoKf1XfYGgvxhwRrfO3JwVMfyv7ROKebgZLRDuVFhde-H5tFa_YMV2Gl19fN0ZpHaj3D1bQ_x3D1msCpxL8BAAD__-Gd1EY">