<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/98741>98741</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[AMDGPU] `LiveIntervals` is inaccurate after `TwoAddressInstructionPass`
</td>
</tr>
<tr>
<th>Labels</th>
<td>
backend:AMDGPU
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
paperchalice
</td>
</tr>
</table>
<pre>
There are some test failures in pull request #98632 when `LiveIntervals` analysis happens before `TwoAddressInstructionPass`, because `SIInstrInfo::convertToThreeAddress` doesn't handle live intervals after folding immediate values:
https://github.com/llvm/llvm-project/blob/ae63db78828621feca713016e33f34717da626a5/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp#L3949-L3961
The live interval of `DefReg` is no longer valid.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUkt9u3CoQxp8G36CsDPjvhS_2nJWPVsqRonb7AAOMbVoWXMCO8vYVTqJGVaWqVwgx8zG_-T6I0cwOcSD1P6S-FLClxYdhhRWDWsAahYX0-mW4LRiQQkAa_R1pwpjoBMZuASM1jq6btTTg9y0_EC76rhGcPi_oKGnKR7Pj1SUMO9hImpKCA_sSTaQLrCu6SCVOPmCuvT37s9YBY7y6mMKmkvHuCWLuI_xfKlHBFo_Sz9ej5OomT8SZiLPybseQbv62BMQ3mfyf9hgd4W2iCzhtkVqzIzXvI1GYEgY6eauNm6m531EbSEh3sBvGLF5eSHleUlqPGx8JH2eTlk2elL8TPlq7vx8Pa_BfUSXCR2m9JHwEbISWbdfxruFsQgUtEyVrUIhJVC1rNTS8gfqDjsl9NwgzZp3z_5f_nr4QPn5APql1JVw8ir7qHx5F37DXIW_LL3jUT3lbF5w-4Zy3YSJ1nlrvZgwZ0ehToQehe9FDgQNredm1ZcuqYhlq1GzqNJbQIce-b9q-qmuGPa-VrpgqzMBLXpUtE4yJTlQn2QNK3ekWGiVBN6Qq8Q7GnjLayYe5MDFuOPRdW7HCgkQbj_xxLkF9Q6eJOL8D85zKMBxrldscSVVaE1P8KZZMskd-31rqy28TZ3JMQaktZF9f_f5D2oot2OGvLT_gIuHjK98-8B8BAAD___tsGp0">