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

    <tr>
        <th>Summary</th>
        <td>
            `ranges::rotate` is not inlined as `std::rotate`
        </td>
    </tr>

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

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

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

<pre>
    Compiled with `-std=c++20 -O2 -stdlib=libc++`, clang v15.0.0
```c++
#define _LIBCPP_ENABLE_EXPERIMENTAL
#include <algorithm>
#include <ranges>

using namespace std;

int main()
{
    // ranges::rotate is not inlined
    int a[9] {1, 2, 4, 5, 9, 535, 2, 4, 6};
    ranges::rotate(ranges::subrange{a+2, a+7}, a+6);

    // std::rotate is inlined
    int b[9] {1, 2, 4, 5, 9, 535, 2, 4, 6};
    rotate(b+2, b+7, b+6);


    // ranges::copy_backward is inlined
    int c[9] {1, 2, 4, 5, 9, 535, 2, 4, 6};
    int temp = c[6];
    ranges::copy_backward(ranges::subrange{c+2, c+7}, c+6);
    c[2] = temp;

    return 0;
}
```
https://godbolt.org/z/z5Kxarerc
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJytVEtz2yAQ_jXowsSDwJKsgw5-ZSbTNM20OfTmAYRtGiQ8AiVNf30XYsWP2j3Fg9fsw99-uwsIW79Vc9vstFE1ftV-i1FObpyvEVtIRGewKME33ygORqMF2EHuXRCL6BxLw9sNfkmzERkRRBaITIMnriHy3UpZrda6VXh1fzebPz6ulg_T2f1ytfz5uPx-93X58DS9_wjVrTR9rTBic242tgN2DWLLS_4OCCh3cEbZOw20Wt4ot-NS4VjV7DhCtx43XLeIThAt955iH4Lhg-gtLDzAT2F11nOvsHa4tR7r1kA59eEfAZKjbFaibIEBKw0NokGMg8iCKOOOZaeuHBWLD34B6t-swPPY6HoRVUjDw6ACStgUAWm_z0Nhp1UfFRZbclrVxYrEJ1U0VCEGuiLS3W8ucP3vKKTdva0El8-vvKuvcpefwz1AedXs4LgtImYOmFfndULt-tjk0Ad5NDZ53ooAHjLSWAWkDzwuDLVTvu9aTA4uADy9ju_q1vtdJBN7urG1sMaPbLcB7U_4Zl9-8051MlFVmudZmpNyQpK6YnXJSp547Y2qAO7CEc3J2d3A3IVH5eyogSXpO1OdUYE73ouRtA0oxrwMPze7zv5S0oOqneshJb3NJpSlybbKGM1rQomQQrJC8SwvVcFYna4nJVd8khgulHEVNBD6l-iKEkpTQoo0H9OsHPH1OhMl45Ox4KRgCo2JgkfBjELi0JSkqyIH0W8cOI123h2c3Dm9aZUa8Hnvt7arfsCzYh9487y1SaRcRb5_AdMWeog">