<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/124796>124796</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[DirectX] Replace generation of metadata `dx.disable_optimizations` with entry function attribute
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
bharadwajy
</td>
</tr>
</table>
<pre>
`dx.disable_optimizations` that has been added to HLSL suppport in clang appears to be potentially unnecessary and not defined in [DXIL.rst](https://github.com/Microsoft/DirectXShaderCompiler/blob/main/docs/DXIL.rst). So, replace it by setting the function attribute `Attribute::OptimizeNone` on entry functions of the module to indicate presence of `-Od` flag on the commandline.
Implement this change and add necessary tests.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyEkjFv2zAQhX8NtRwi0LQk24MGJ4bRAGkDNEu24kieJQYUKZCnpO6vL-g6CdChnQRB957u3vswZzcEol60t6I9VLjwGFOvR0xo3_DlXOloz73opP1ZW5dRe_oRZ3aT-4XsYsiik8AjMoyYQRMFQGvJAkf48vD0AHmZ5zkmBhfAeAwD4DwTplwmNMEcmQI79P4MSwhkKGdMZ8BgIUQGSycXyBa5aG8Pz_cPdcos2oNQ25F5zmK9F-oo1HFwPC66NnES6vjVmRRzPLFQx4NLZPj5aURL6S5Os_OUhDpqH7VQxwldEOpoo8ll-P0PalfDUxTqDhLNHg2BY9BnyMTswgA8EpyWYEoKgMzJ6YUJRCf37y9ltfX-8U9c9C0GKmnFABQ4nT_UGeLpYjdFu3gqwbhgnUEmmBNlCobKiOjkzaMtFiePQ_EpIhOnCYP1LlAt5F7I_f00e5ooMPDoMpgRw0CXQNFa-IyYKXOuK9uv7W69w4r61Wa9ldtWrdpq7BvVNBrXttGmI0K9M10jO0mNUrLTG125XknVypXarjaqa9u6s9s1ma3VqlutulaJRtKEztfev051TEPlcl6oX6lms-sqj5p8vqCnVKA3uHwVShUSU19EN3oZsmikd2XVDxt27C_MXqsV7QG-X1saKFC6sFkym4jRIiP8B-E3x-NftXyWWi3J9_-Arex1fdzMKb6QKdhdrilIXc997dXvAAAA___noyk3">