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

    <tr>
        <th>Summary</th>
        <td>
            Performance issue using std::fill() on armv7-a clang 11.0.1
        </td>
    </tr>

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

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

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

<pre>
    Using `std::fill` on a short array.  
It generates the following asm:
`.LBB0_1:`
`        add     r3, r1, r2`
`        add     r2, r2, #2`
`        cmp     r2, #2048`
`        strh    r0, [r3]`
`        bne     .LBB0_1`
but could be optimized to be something like that:
`.LBB0_3:                `
`      strh    r0, [r1], #2`
`       cmp     r1, r2`
`        blo     .LBB0_3`

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx9k01v3CAQhn-NfRnF4sNe2wcfso0qVeqhqtRzhc3YpsVmBThR-us7ptlt2t0EIWDgYXh5Bb3Tz923YNYJsgMLUWfynuporKUY3AoKwux8BOW9ei4AMvaQsftPESZc0auIAeKMMDpr3dOeR4VlT5IwylF8Ph7Zd75PHdhlFl6K0jr1XmbiA3ieWvEuKV4YajMhb7LDcnrF7hQrm1tgiH5OIEtgdSQd1cMtsl8x9efrnJF-izC4zWroEdwpmsX8Qg3R7XFwC8Z5N8Wan0g-qXhtjaQp-K9cK7hWynelb5tw8eAdT3vrXl1KXpBcd1K3slV5NNFi9wX96Pyi1gHBhLAhbOnJ_PteRJOJNj0ZvzzWdwoGqwjivGAFzzdvuznGU9h3iI9UJxPnrS8Gt1Bg7eO5uzt59wOHSGE6LNCgKmVV5XPHh5KJRvJ2rLmsGG9lMzSsaWrdNGOJh9yqHm3oyKBMiBWf_uilMbmVm04wIZjkgh_YgcuiLtWgKVnLdD0ik1nJcFHGFruOwvkp912S1G9ToEVrQgx_F1UIZloR03GUX22R_kr3lX7G1NYyT2d3Sftvt1PsPw">