<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/126784>126784</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[DirectX] Register properties not initialized, causing UB in passes
</td>
</tr>
<tr>
<th>Labels</th>
<td>
backend:DirectX
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
llvm-beanz
</td>
</tr>
</table>
<pre>
The DirectX backend doesn't currently describe register types and call `computeRegisterProperties`, so when passes look up cost heuristics for registers they get odd values which can cause passes to do weird things.
For example @farzonl observed loop unrolling happening or not depending on if the underlying register weights were zero-initialized or garbage-initialized. Obviously not great.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJxMksuO2zoQRL-G2jRGkKiHrYUWnjvw9gZBAmTLR1tkhiYJNmnH_vpAgu3MSkKDrOoqHkFkF484s-GdDR-VKNmENDt3Ob9JFP5eyaBv8w-D8GETqvwLpFCf6DXogOQZ32VQJSX02d1AI6lkJULCxVLGBPkWkUB4DUo4B2xsVDjHkvH748S3FCKmbJHY2DD-H1CAq0EPURAhgQvhE0oEFSiDwZIsZasITiG9XAiywRssmCFoDRfhChJcjVUGlPCgRCF8CuYAOsAVbdKQjfUL1aw5sOZwDAnwjzhHh8D65iTSPXgHQRKmC-p1kwjFp-Cc9QsYESP69S8k8CGDxohebwMP9rTuBMVrTO62Dl-VXNEuJhNcMSHcMYU36222wtk76lVsEUmKBb-Oa_hfXmwo5G6b15JQ5LrSc6enbhIVzu2um7qmHbpdZeap60-nZhTjXnHOUe6xlY2ces7Hk9S9rOzMGz40vG3bqd0PY81x6IXq9nsu-STHifUNnoV19YpCHdJSWaKCc8vH3b6vnJDoaKOG8wcRrDs8GGGcrzA9OSoLsb5xljL9k8s2uw27553hA55MQHxBsaX9UsRKyPqca6M_38E-OalKcrPJORLrDowfGT8uNpsiaxXOjB9X38fnLabwG1Vm_LhlIsaPj1iXmf8NAAD__2BtD_E">