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

    <tr>
        <th>Summary</th>
        <td>
            [AArch64] does not use rev32/rev64 instructions, resulting in redundant shift operations
        </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/jzdcsfxx4
```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 unsigned short __attribute__ ((vector_size (8))) v4hi;
typedef unsigned int __attribute__ ((vector_size (8))) v2si;
 
v2di
G1 (v2di r)
{
  return (r >> 32) | (r << 32);
}
 
v4si
G2 (v4si r)
{
  return (r >> 16) | (r << 16);
}
 
v8hi
G3 (v8hi r)
{
  return (r >> 8) | (r << 8);
}
 
v2si
G4 (v2si r)
{
  return (r >> 16) | (r << 16);
}
 
v4hi
G5 (v4hi r)
{
  return (r >> 8) | (r << 8);
}
```

GCC efficiently uses rev32 or rev64 to complete the operation in a single instruction.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyslN1uozAQhZ_G3IwamTEQuOCCpiX7FhHYA7hLcNY26c_TrwztNuq2UqtWssCMh0_nHME0zul-IipZes3Sm6iZ_WBs-fuqsdbcu6g16rH8RZZAO_ADgTSKoLPmCL2U4Ml5N2tPG8arwfuTY6JiWDOse6NaM_qNsT3D-olhffekpOseHhLGK5bxdUnGK_94IkUdyKGxcDg03lvdzp4OB2CYM8zPJL2xB6efKFTijGGxLjjH2R_NxPUFZp4WTwrcYKz_MjAfPuLp6eu0xH1EG83Ur5evMlF923F-KfG7hi9h-OIXGK8Wpbzax6ErPIANfbxi26UFLPnZTuHUAhO3TNyCwMBh291LdcfEbq2uYLa9ecGHcHm1xwWfuM_glyD_w6_xvsWHL4FXe7Hg8-Ez-Pw9ev4eHFftyRrNj2tPVu3pGs3Paf_344Y9r_a7HVDXaalp8uMjzI4cWDoLBGPDJkvAG5DmeBrJ0zJCzIls47WZQE_QgNNTPxLoyXk7y1DfRKoUqhBFE1EZb5M45RwFj4YyxnZbqBS3qFDJVnY8lp1IBHWZKDAXkS6RY8oFL3jGRco3apvIVspUFTnHNo1ZwunY6HEzjudjGE6Rdm6mMhY8yYpobFoa3TINESe6h-WUIYbhaMvw0lU7944lfNTOu1eM135cxmhVWTlkCUtvQBlyMBkfYllTYVivoVzYdQx3YMnNo9dTH0KxpOZJNZMHN-jOvybmotmO5ZtBq_0wtxtpjgzrIOf5dnWy5o6kZ1gvJhzD-tnlucS_AQAA__8de8Ka">