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

    <tr>
        <th>Summary</th>
        <td>
            [DirectX] Implement Shader Flag Analysis to collect properties of DML shaders
        </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>
    DML Shaders in test suite of DirectML repo that are compiled using `dxc` (with designated command-line options in the test configuration) generate one or more of the following shader flags.
- [ ] m_b64UAVs
       This is a module-level flag. Set if number of UAVs used is > 8 - see [here](https://github.com/microsoft/DirectXShaderCompiler/blob/a023a95f73618e8ca1791147d3722a3e1ea7608f/lib/DXIL/DxilModule.cpp#L328)
- [ ] m_bEnableDoublePrecision
       Set if the candidate function uses an instruction of double type (viz., `llvm::Type::TypeID::DoubleTyID`)
- [ ] m_bUAVLoadAdditionalFormats
       Set based on properties of `DXIL::Opcode::BufferLoad`, if present, in the candidate function - see [here](https://github.com/microsoft/DirectXShaderCompiler/blob/a023a95f73618e8ca1791147d3722a3e1ea7608f/lib/DXIL/DxilShaderFlags.cpp#L605)
- [ ] m_bLowPrecisionPresent
       Set if the candidate function uses an instruction with operands of `llvm::Type::TypeID::HalfID` or `Int16Ty`
- [ ] m_bInt64Ops
       Set if the candidate function uses an instruction with operands of type `Int64ty`
- [ ] m_bEnableDoubleExtensions
 Set if the candidate function calls the intrinsic `DXIL::OpCode::Fma`.
 NOTE: Code to set this flag if the function uses one of an instruction is one of the instructions `Instruction::FDiv`, `Instruction::UIToFP`, `Instruction::SIToFP`, `Instruction::FPToUI` or `Instruction::FPToSI` is already implemented.
- [ ] m_bWaveOps
       Set if the candidate function uses a DXIL WaveOp - see [here](https://github.com/microsoft/DirectXShaderCompiler/blob/a023a95f73618e8ca1791147d3722a3e1ea7608f/lib/DXIL/DxilOperations.cpp#L2825)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzMVsFu4zgM_RrlQiSw5dhODjmkTY0NkG4LNJ2d20K26FgDWTIkOW326xe00063zXSAncvkYjsUxcf3SILCe3UwiCuWXrF0MxF9aKxblY1wQj6Jb6dJaeVptbndwUMjJDoPykBAH8D3KiDYGjbKYRVud-CwsxAaEUA4hMq2ndIooffKHIBlkXyuWBYB44snFRqQSLFFQElnW2HkVCuDYLugrBkDNTgGq6yp1aF3gkyML-GABp0gAOThoLVuAEMetdXaPlFQP2CGWouDn7Fow6L1FFh6BSzdQPt3mc0f11_8aIDxt2-UB-VBQGtlr3Gq8Yh6uGIGDxhA1WD6tkRH4cgdeo-SXFhyAwuYgkekIA06ZOmG8UUTQudZsma8YLw4qND05ayyLeNFqypnva0D48VI5NeR6OuRPsd4UWpbMl6IiCdimdZ5ksULXFQizpdxPM9lknMuEoxR5Fm0qBkvtCKHzdftjh7PSt8OucyqrmM82SV8wfjyAh83RpQaN7YvNd47rJQnut_Sc2aAaK6EkUqSBnVvKhKGmPAgDCjjg-vH_2wNcrgQwqlDUv-o_pkxfk0lofWxJWKS9f7U4fe37WZ8H6HsT9sNy6LLmB_XX3ZWyLWUiuIJXVjXiuA_wC4F6WQNdM526IJCT-BYFg1EDfHuusrKM46rvq7R0d1D7GvKu3Po0YThy_yIhd-yAsY7i6ETzmWQRellSnf26VX9-3PGv1YEQ8MT68LIF9Z_pv0fQteD7tTfLIu2JsTZ_kRifIS8NSGb33UfVf9FnGPNDsGzefhB8Ldtc_Mc0BBxL1A-B1EJrf1gVCY4Zbyq3lfk9WtFFq1gWXQeZPDn3f6GJWsgOwQLHgMEml40q15C_jfbYVjW75NWr4YRx6vFj5m_fp9RbNTx3BGXzI_bvS3uPznw8LMDxf3ePm7fCn_hwMNwgAa1dijkCVTbaWzRBJSXRv1f4oj_pz6ApIDR-_fs7Dsq10Gul8bmC06dPZGrRC6TpZjgKs75Mucpz5NJs4p5Es_neZ0sRSzzfCmSOK-TvJTLvOYCy4la8YjP44gndDJJZtUi4alc1Ms0m9eLOGLzCFuh9IyaeGbdYaK873EVx0kapRMtStR-WCo4N_gEg5VxTjuGW5HTtOwPns0jrXzw368JKuhhGzkTRuptX5Q97yBAUwzWRuiTV55Kv7JaYxXeTXbaWsYNwE96p1efSDXMovEx7Zz9hhWJNqD2jBfntI4r_m8AAAD__2Rh658">