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

    <tr>
        <th>Summary</th>
        <td>
            [DirectX] Run shader flags analysis before DXILOpLowering
        </td>
    </tr>

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

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

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

<pre>
    We should run shader flags analysis before DXILOpLowering, so that it can work with DirectX target intrinsics rather than having to recover information from the lowered operations. This will significantly simplify tasks like #118140 and #114557.

Note that this will mean very late passes (ie, DXContainerGlobals) shouldn't rely on shader flags analysis directly, since it won't be possible to re-run it if it's invalid at that point.

To do:
- Move the translate metadata pass after the dxil op lowering pass
- Update DXContainerGlobals to get the shader flags from metadata rather than analysis
- Add asserts if flag analysis is run post lowering

</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyUk0GP4zYMhX-NfCEmsBR5khx8SDdIUWDbAsUWnasc0TY7imSITNL8-0JKOtOi6KEn2yAeyfc90zHTFBF71X2nukPjLjKn3A9pipibIfl7_xsCz-kSPORLBJ6dxwxjcBODiy7cmRgGHFNGOLz98PXn5Wu6YaY4KfMFOIHMToAETi7CLeV3uJHMcKCMJ3kDcXlCAYqSKTKdGLKTGXORRZjdleIEkiDjKV0xA8Ux5bMTShHGnM4gM0IoE9FDWjDXEq_g20wMNwoBikMa6eSihDswnZdA4x3E8TtDoHcEZdZab7VtwUX_-LJdt1mpdq_a_U9J8OFCPnqe0UW4Yr5DcIKwOGZkUGZLWGwf3r6kKI4i5u9DGlxgZXZPjFGZjUDGcIf0Xzx9pRPuFSHFExaAt_SQDghLYqYh4IPMSwmGBGgEEmU2DBSvLpCHurMTWBJFedr5lsAntS6vL_BjumJFKNlFrl7OKM47cdUUuFFqGAj-DwqQlgfskkqp1ya_Lr4I_226rFfSLfJ_GK3JfQz6e-J_IaiN995DIZuFi7mi_WREXH_IJbF87KTafeP7td-td67BXm_Wdr3R2u6aue_sdr01HdpXP2797tUavx61GbS1rdG-a6g3rbHa6Fe9sZ3drcau23rjt8ZuW-2sVbbFs6OwCuF6XqU8NcR8wV6bVutdE9yAgeslGRPxBrWqjCmHlfsiehkuEyvbBmLhzzZCEuoJPq9CdQf45f8dW3PJoZ9FFi7RmqMyx4lkvgyrUzorcyyzno-XJaff8STKHOuGrMzxaeHamz8DAAD__zDbY4c">