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

    <tr>
        <th>Summary</th>
        <td>
            rva22u64_v regression on 525.x265_r
        </td>
    </tr>

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

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

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

<pre>
    Between 6e498bc2cd765f4c421d32d610bdc0effec62b42 and c7579bfba5969377f7fb4239cc05d6cd4a077957, the SPEC CPU 2017 benchmark 525.x264_r has regressed about ~9% on the spacemit-x60: https://lnt.lukelau.me/db_default/v4/nts/graph?highlight_run=133&plot.0=25.13.3

It looks like this is made up of several independent regressions over the last few days since the 23rd of January, the first one being a 6% regression between 6e498bc2cd765f4c421d32d610bdc0effec62b42 and 26fc07d5d88760ad659599184fd10181287d2d9e.

The cause of the regression is mostly due to the function `pixel_hadamard_ac` being unprofitably SLP vectorized in a lot more places, which can be viewed in the profile here: https://lnt.lukelau.me/db_default/v4/nts/profile/13/133/130

Noticeably there are now 8 new LMUL 4 `vrgatherei16.vv`s which are very expensive.

There were a few SLP related changes landed during this period which may be relevant, #123896 #124254 #124129. 

Are we missing something from the RISC-V cost-model? cc) @alexey-bataev @RKSimon @HanKuanChen 
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJykVE2P2zYQ_TX0ZbACRVFfBx82mxpNkxZBtunVGJEji12KNEhKXvfQ315Q9iLba3uhCH68ee_xaTBGc3JEe1Z_YPXHHS5p8mFvlxeyfbsbvL7uP1C6EDloSPbdoITSbVOPUklR6kropuSDVpzGkVQjBikAnQbV1m0_jAPWfdNXbTu24yBF1SvFa90oLZG3bV-3TDxBmgiev_70BE9fv4PgZQsDOTXNGF6gFnXxKhp5DDBhhECnQDGSBhz8kuDvnokavNsw4hkVzSY9vDacVY8wpXSOrHpk4sD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