<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/91998>91998</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[SPIR-V] The order of instructions leads to errors in pointer element type deduction or crashes compilation
</td>
</tr>
<tr>
<th>Labels</th>
<td>
backend:SPIR-V
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
michalpaszkowski
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
michalpaszkowski
</td>
</tr>
</table>
<pre>
The current implementation of SPIRVEmitIntrinsics sometimes allows generating duplicate `spv_assign_ptr_type` and `spv_assign_type` intrinsics.
In these cases the order of instructions (and which intrinsic is selected first) plays a role in correct type deduction. In other words, the order of instructions or operands sometimes leads to incorrect type deduction or compilation crashes.
TODO: Add a simple test case
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx8kkFv4zgMhX-NfCEaWLKdxAcfspsNkFMXu0WvhSIxsaayZJB0g86vHzjJtJ2iMxdbAMHHx4_PModTQuxU85cyZgiut3G0_P05n_k5KGNUsy3sJH2m7nO1OGT_2j30CG4iwiQQhjHigEmshJwgH-H_f_f_Pf4zBNknoZA4OAbOA0oYkMHGmM8MJ0xIVkI6gZ_GGJwVBLUseXx5ujp8GoWe5HVEtSzBJv-p-rMS3oYsVLlV5eb63SeQHhnBWUae35DJI80GQ2Khyc1-GZRZz-LnPrj-XQwCA2NEJ-jhGIhFmRbGaF8ZLFCOCCGBy0ToBGYv4NFfNRewT5ClR4JzJs_K_P2H-Zkgj0g2-Y-UIlrPIBlC-nrI3OfyMIZ45e7Ico-_Mni4396ragMb78ECXy4FgiwXKIXvKt9WrS2w0yvdLE1Zt-ui71xtj9gs11prvaxqvTYt6qPxXruqbowtQmdKU5eNrvRK1816UbdrhyurV03VlMaUqi5xsCEuYnwZFplORWCesGt1266LaA8Y-Ra_g3XPmLyqNnNs7h5v8aNubr07TCdWdRkDC7-LSZB4ie-tpdnCw2_5vpFEokw8n23MIQkS4DW4X5G90vxIuJgodr3IyKraKLNTZncK0k-HhcuDMrvZ3e13N1L-hk6U2V32ZmV2l9V_BAAA__-_6jKs">