<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/89952>89952</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[DirectX] Fix DXIL part header version encoding
</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>
Today we are encoding the DXIL version in the DXIL part's program header backwards. Compiling a shader targeting `lib_6_8` with DXC then disassembling it with `obj2yaml` prints:
```
DXILMajorVersion: 8
DXILMinorVersion: 1
```
This probably means we're crossing the ordering of the fields somewhere in our handling.
We also need to set the DXIL version from the triple sub-architecture. Right now during DXIL header generation we are not setting the version. See [here](https://github.com/llvm/llvm-project/blob/main/llvm/lib/MC/MCDXContainerWriter.cpp#L121) where we set the shader model version but we don't set the DXIL version.
## Acceptance Criteria
* Updated obj2yaml tests verifying correct reproduction of major and minor versions.
* Updated llc -> obj2yaml testing verifying correct code generation from llc.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVEGv2zYM_jXyhXiGLDtxfPAhTRZgQHvZuvXdCllibHWyZEh0s-zXD9KL-_raXWYINkSKHz99pCljNKND7NnuHdudC7nS5ENv7df5aUDp_ikGr-_9R6_lHW4IMiCgU14bNwJNCOfnX9_DVwzReAfGvdoWGYiJNsIS_BjkDBNKjQEGqf66yaBjCSc_L8YmJAlxyl6SYURKJrbn1gyf958PbM_hZmiC8_Mp4TvQJsoYcR5ysKEXN9tzP3wRdznbFLIE4yiy-sh4Xnv-WPwI-Uk0P8gvPvz5Qp_VRzi89Rr3xlv9gMP48eNk8hUHOdg7zChdhBsy0QYEFXyMm1A-aAxp4695fzVodYToZ7xNGDCJ59cAk3Q6Xat8wf-EIG304BA1kIeI9LPu1-DnbKVgFosQ1-FJBjUZQkVrwBJ-M-NE4PwN9JpZ5PhHSUZ0GCQlpEeJnaeUiTbyj0Ql_I4IbPcuEWa7MxOHiWjJIosLE5fR0LQOpfIzE5fURI_P0xL8F1TExGWwfmDiMkvjvjtjku3DKb_OzyfvSBqH4VMwhKFUy8JE_b4SFRMdvMh1w29aPHpn9hrtN02GldIZ7R0TLf2nbg-JmaiZqOGoFC4knUI45bRGbv4j_LFoSahhazAgjBQTkLnek0rKh4CKIOASvF5VVtNfYU4NBtJpmFMzbalj-QOwtQqeWP3L2wwJ-eccymv8vmi5_NaqstB9rbu6kwX2VVvVXXto9k0x9XXdyUM7qGbHxbWTe8EPVVtVXV1fVduqujC94KLhjWiqlreNKA8Vb69tzbkaWiE5Zw3HWRpbpoqVPoyFiXHF_tB1O1FYOaCNeYgIkf5wdJrVx7NJfJ-ZEGm2bGNlHSNruDWR4isaGbJ5Cm0xuzNczN-vs2Rr1q2-2xQq1mD7_92FmXxk4pL5_xsAAP__kCWrHA">