<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/151564>151564</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [HLSL] [DirectX] Do not mark functions with `OptimizeNone` when compiling with `-O0`
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          Icohedron
      </td>
    </tr>
</table>

<pre>
    As discussed in the HLSL Working Group Meeting on July 31st, we should not mark functions with `OptimizeNone` when compiling with `-O0` so that optimizations are still allowed to run on HLSL functions. 

This is required because of passes such as SROA which explicitly skip running on functions marked with `OptimizeNone` despite being required for legalization to DXIL.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJysksFu2zwQhJ-GuixiSKQl2QcdnN_w3xRpAzQFmitFrkw2NKlyyaju0xd03OTUW0_CYrUz8xEjiezRIw6svWXtvpI5mRCHOxUM6hh8NQZ9HnYE2pLKRKjBekgG4cP94z18C_HZ-iP8H0Oe4RNiKlPw8DG7M4iGEuP_wYJAJmSnwYcEJxmfYcpeJRs8wWKTAdbVD3OyJ_sLPwePrKthMehBhdNsXdH889vNQ122FCAZmSC8XslXLRkRKFnnQDoXFtSQAsTsS6JL3jfbFbB6x-rdV2MJLEHEH9lG1DCikpkQwgSzJEICysqAJHj88rCDxVhlAH_Oziqb3Bno2c7Fwl_B38EKJ-q_8mmk2SaEEcvlm_8UIjg8SneFKgT7p7v7VaUHobdiKyscmr4V241oRF-ZoR3H7dRO_dTUXdepjV6LfpRcSzG1ddOJyg685m3di6bpBW_6lRg3Wmi17jaCi6bdsHWNJ2ndyrmX0yrEY2WJMg5N27TdunJyREeXhnDucYHLlnFeChOHcnQz5iOxde0sJXqXSTa5S7XK47N2D6y93duIKj2VaR_-WSGqHN1gUpqJiR3jB8YPR5tMHlcqnBg_lEjXz80cw3dUifHDBYQYP1xJXwb-OwAA__-DgwZg">