<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/122237>122237</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Scheduler causes spilling by reordering wide load before MFMA
</td>
</tr>
<tr>
<th>Labels</th>
<td>
backend:AMDGPU
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
kerbowa,
jrbyrnes
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
arsenm
</td>
</tr>
</table>
<pre>
[scheduler-causes-spill-load-mfma.ll.zip](https://github.com/user-attachments/files/18359164/scheduler-causes-spill-load-mfma.ll.zip)
In this testcase, disabling the scheduler avoids spilling. If the load and mfmas are manually ordered to minimize the live ranges, the load is hoisted which induces spilling. Additionally, if the load and mfma aren't manually reordered, the scheduler doesn't help by sinking the load past the first mfma
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyMUs1uozoUfhqzsUBwDAksWHBbcdVFpStdzQMYfIDTGjvyManSpx-RpM0sRqNZIaPz_erTzDQ7xFZU_wiAdwyD_9ACQMCTAHgLwyU45P1H9ZzoLS4-tDowujUZvLnsOB4XNJvFkI56Y-SUT2Rtar026TqtOrM2-6STqJ4F1EuMJxaqE9AL6GeKyzZko18F9BtjSHWMelxWdJEF9BPZXbwvalU1xaEU0P-tGjQi70TevTgZF2IZkeOoGQU8SUOsB0tulnFB-c0o9dmTYXllJDdn8mW6XuzkUjsjdwGWOqBctdu0tRfpg8GARkYvV3K00ifeMHRGGbSb9wBPDxpiuXjiiEZ-LDQukpzZRvxVtTOGInm38-9Y-o2L3YQTcIwPJwHvXr70HsGMR75dL2hPcrhIJvf-VcCV-KQ5Xl8TBY43jcS0yjSq0Qm2xVEdyqIsFSRLq8ZaqbGpzVFp1EeshzE_1OVkVF4ZUx4TaiGHKi_yJm8gV5ANFUzFeJiaKj8gDrUoc1w12cza85r5MCfEvGFbAIA6JlYPaPm-ykGP7-iMUF33-vzvfz_uawztjk2HbWZR5pY48oMtUrTY_v_dwG0s3yXvFdz72l8fZO41DDj5gPK1f-2SLdj2D3vdte6f9BT8G45RQH-Ncd3sLcm5hZ8BAAD__2NkJOI">