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

    <tr>
        <th>Summary</th>
        <td>
            RVV spilling when using VCIX instructions with `-mtune=sifive-x280`
        </td>
    </tr>

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

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

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

<pre>
    We encountered a weird problem where using `-mtune`for the X280 results in a very poor codegen: https://godbolt.org/z/qfzKMcq84 (note that by adding more blocks the problem gets worse and worse as we get more spills)

My hypothesis is that due to the recent change to allow reordering VCIX instructions, the scheduler tries to move all the loads before the VCIX instructions. What is surprising is that it doesn't seem to take into account register pressure?

@topperc and @michaelmaitland Any ideas what's happening? Thanks!
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxkk0FvuzgQxT-NuYwSOYaQcOCQbYW0WvWyWrW9GnvA3hqbekzY9NOvTFr9q38vgGY08348P0siO3rElh3_YMfHQi7JhNhOVhnpUtEHfWtfENCrsPiEETVIWNFGDXMMvcMJVoMRYSHrR2A1301p8chqPoQIySC8ijOHiLS4RGA9SLhivMEcQgQVNI7oWXkBk9JMrLww0THRjUH3waV9iCMT3QcT3fvw8deTej9XwMTZh4SQjEzQ30BqnbWnEBF6F9QbbbpffCMmgjVEQpBef30RrJhb9zGarXPERMP4I-OX-_PpBuY2h2SQLIGlu6BeEFLYFCIq9AmUkX7citK5sELEEDXGzPT88OcrWE8pLirZ4ImJh22UlEG9OIyQokXKw1O4Yt6w9V2QmqDHIdPlwo9Ne3jJOJaAljhHu_n_BWkT6IDkmTglIMRpQ5ZvCNZnTrUdJ0QcLSWMMEckWiKysvvuAKt4CvOMUW3WsYpvwUA3SZtcLl38DazGbKeRiYkTgZHzjN76kZUd_GOkfyMmDoVuS92UjSywPZx4c2iOBy4K0-JJDadGqFMlT1WFOKAeVK0OsuRC6VIXthVcVFyIhp_FkYv9cegbUR-PvD7zuuYDqzhO0rq9c9cpJ6awRAu257JsDoWTPTra8i2ExxW2JhMixz22eWbXLyOxijtLiX5tSTY5bP9-fr7HI_u7GvSfUf9xILDaZL7dgPKR7GCvuPtPnDmrebFE1_6WcpvM0u9VmJjosu7nazfH8C-qxES30RIT3fY3_wcAAP__NIE_Gw">