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

    <tr>
        <th>Summary</th>
        <td>
            [AArch64][SVE] Fold svrev(svrev(v)) to v
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

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

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

<pre>
    GCC has implemented this (see [patch](https://github.com/gcc-mirror/gcc/commit/f0eabc52c9a2d3da0bfc201da7a5c1658b76e9a4)). Consider the following example.
https://godbolt.org/z/xj86nKn51
```cpp
#include <arm_sve.h>

svint32_t f(svint32_t v)
{
  return svrev_s32 (svrev_s32 (v));
}
```

GCC:
```asm
f(__SVInt32_t):
 ret
```

Clang:
```asm
f(__SVInt32_t):
        rev z0.s, z0.s
        rev     z0.s, z0.s
        ret
```

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyck11vpCAUhn_N8YaM0YP4ceHFjFObzV426e0EAUe6KBNA2-2v3zhOt93uphdLjHDg5fDw8XLv9XlSqgZ2AHaM-BwG6-ofO-6cffZRZ-XP-r5pyMA90ePFqFFNQUkSBu0JYOmVIsAOFx7EAOwIWA4hXDzQPWAL2J51GOYuFnZcAyF2o3bOui0AbIUdRx0A2z5RvBMMRcVRUsmTrheYpJIXnIk0Z2VX5KriGWAFWMWksZPXUjkSBkV6a4x91tOZqBe-UsaQHCHZf2KxsrMmxNadAdtXwPblqcyn7xNLNznkyfaJy-XWg1RPwsxSEaANd-PJLyoegN7dxq9_v-gpUDwF0q9H8jtaVthNVxy2BiFOhdlNxC9OLSdP8XqKH4Nl2yLQw9vc4ye8j2vfN826wT8F3I9bz8pzOj08ftuIrmlv4hXki7yN4dP5PzPfilMLeU1iD9hs9V-ja_lK8W_ASNZUVrTikarTAoucUVaxaKi57FNBpSyrivYV78qi5KnKCioSltIUI11jgllSYYU0yymLOWOsElnfZzTjSBGyRI1cm9iYZVwfSqS9n1WdpkmWZZHhnTL-zSyuXlW7bj57yBKjffDv84IO5mqr_d6JIc9Wc7DDw-MdsCNprZHbC3i7_Pd7J8GSJZqdqb9w0rrMrdpdnH1SYvXQldUDtjfcpcZfAQAA__9ikRiH">