<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/71692>71692</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[CodeGen] Reserved registers frozen multiple times
</td>
</tr>
<tr>
<th>Labels</th>
<td>
backend:AMDGPU
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
nikic
</td>
</tr>
</table>
<pre>
Based on our documentation, it sounds like the set of ReservedRegs is supposed to stay constant after it has been frozen:
https://github.com/llvm/llvm-project/blob/98d8b688bd351850ca99d3e5e9dfdf582c83c4f4/llvm/include/llvm/CodeGen/MachineRegisterInfo.h#L901-L911
However, in practice we call freezeReservedRegs() at least twice, once during FinalizeISel and then again in RegAlloc. Adding a check to not touch the ReservedRegs if they have already been computed results in a bunch of verifier failures in AMDGPU.
I think *something* is wrong here (possibly just our documentation), but I'm not familiar enough with the subject matter to figure out what...
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUk8-O2zYQxp-GugwiSJRliwcdnCycLpAAhYs-AP-MJMYUaZBDG96nLygn3S3QSy4SSInDme_7fTIlO3vEkfWfWf9SyUxLiKO3F6srFcxj_CwTGggeQo5ggs4repJkg2f8C1iCFLI3CZy9INCCkJAgTHDGhPGG5oxzApsg5es1lFIUIJF8gA4-kfQEciKMpdIiEyhED1MMb-hZd2TNC2uOC9E1lRU_MX6aLS1Z1TqsjJ-cu_16fbrG8AM1MX5SLijGT2Iwg9oPgzJd3w59o6UQpsMehZnM1A9cD53eTbv3OtZrlw2-b3wJBr-iZ_z0XerFejzjbBNhfPVTqBfGu2-iaT99E2377PX5_CPc8YZxU8jDNUpNViPcEbR0DqaI-IYfFWJ8YFyAJHAoEwHdrcZyPHiNYHK0foaT9dLZN3z9Cx1Ib4rcHuQsrS_XnHE-Ohd0DUdjyv8S9IL6UhT3gYBC1stm0X-9mcreAxZ5Q5AuojSPpw06rNdMaCBiyo5SuUSCyl4vxeEbRjtZjDBJ63LE7fvx-8vXP_-uP4rxCrRYfwHGjymsWBYz48cCxT0GP8OCEYHx4RpSsso94EdO9H-8iaKIygSvjB_WbahJrtZZGQF9yPMCd0vPGVNWhQZYJRW8KMBk5xwRQia4L5Lquq7M2BnRCVnh2O6F2PWHQyOqZcRJqFYeDkOzb_pOaC642DXDjislD_tpV9mRN7xr22Zo-65vRK1E2xvd6r08tPt26NmuwVVaVxeQ6hDnyqaUcTy0e8ErJxW6tIWOcyX1Bb1h3fEpHuO8RDGOG9Uqz4ntGmcTpfdiZMltof0FaP_yr6sQfzKafgYJ1uzIXh0C2RVTlaMbfztTW_uJ8dM2wT8BAAD__55CaKw">