<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/108845>108845</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[SPIR-V] GET_ID instruction generated after the instruction using its result
</td>
</tr>
<tr>
<th>Labels</th>
<td>
backend:SPIR-V
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Keenuts
</td>
</tr>
</table>
<pre>
MIR register usage must be dominated by their definitions.
The SPIR-V backend generates the instruction after the user, meaning we break this requirement.
Seems like the fix is in `SPIRVPreLegalizer.cpp`, the `setInsertPt` call might have the wrong param.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxUkcFu2zAQRL-GuiwiULQkWwcd0roujLZAkAS5FpS0krahKJe7TJp-fUHbRdMLCZCcGe48y0yTR2xV9UFV-8xGmdfQfkH0UTjr1uGt_Xa8h4ATsWCAyHZCWCILdAjDupC3ggN0byAzUoABR_IktHrOld4rffs4IzzcHe9vnqCz_TP6ASb0GKwgJxGQZwmxTxqwY0pJp5ExKPMRFrSe_ASvCF1A-wwyE0PAn5ECLujlGnNZHxAXBkfPeDYZ6RcQA3lQtU6feLoL-BUn6-g3hrw_nVStU0p6rGrNKEfPGOROVK2ht87BQtMsMNuXi-VrWP0EJxvskmdDuxmaTWMzbIutqSutS6OzuS1H7Jum6zuzHRo7GCytrvvB1GXZj6Y0GbVGm1I3RV1UZqt1jgXW4243bMdq21VFoUqNiyWXO_ey5GuYMmKO2BZ6tyurzNkOHZ-xGXOtVW1uLz0rYxLM0CbtTRcnVqV2xML_3ITEnbFfJdUePn96_H7c_4fjL6jhHZj395ETGpIEhKOTLAbXziInVptbZQ7KHCaSOXZ5vy7KHFL8dbs5hfUH9qLM4TwZK3O4DvfSmj8BAAD__3vz3B8">