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

    <tr>
        <th>Summary</th>
        <td>
            [DXIL] Overload Types for argument and return type are confused.
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            backend:DirectX
      </td>
    </tr>

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

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

<pre>
    Below is an example branch on how you can trigger this issue:
https://github.com/llvm/llvm-project/commit/66e406197d7699dddf860d16ab705ac975ca32d3

if in `DXIL.td` return type is bool and argument type is float (ie `[llvm_i1_ty, llvm_float_ty]`) we incorrectly convert 
 `%dx.isinf = call i1 @llvm.dx.isinf.f32(float %0)` to `%1 = call i1 @dx.op.isSpecialFloat.i1(i32 9, float %0)`
should be `isSpecialFloat.f32` not `isSpecialFloat.i1`

if instead we make argument half or float like so  `[llvm_i1_ty, llvm_halforfloat_ty]` then we fail in `DXILOpBuilder` 's `getOrCreateDXILOpFunction` 
https://github.com/llvm/llvm-project/blob/aa68e2814d9a4bad21e4def900152b2e78e25e98/llvm/lib/Target/DirectX/DXILOpBuilder.cpp#L257C3-L259C4

We have an `Invalid Overload Type` fatal error because we tried to and a bool overloadType with a FloatKind.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycVE2PozgQ_TXOpTTINhjCgUN3R5FG21IfdqSd26jARfC0YyPbJJ399SuT_si0dg87F7Cpqser5-fCGM3BEXVM3TMp-wkD6jP-vDApmdptcEmTD92I4W_v7Kb3-tLdk_VnMBHQAb3gcbYEfUA3TOAdTP4MF7_AgA5SMIcDBUiTiWBiXIiVd4zvGL-bUppj3sk9k_uDSdPSF4M_Mrm39vT2-jIH_5OGxOR-8MejyYu6porXom10U7et1nrc1lyLGvuGKxzaRg1YSl1e_3N9mhGMA1bz3fevj0XSrOYQKC3BQbrMlJvpvbeATgOGw3Ikl94jo_WYgMmtoQzB1H2m9sOIH-nC5AOsuzUpf1C7nCNbOBMYN_gQaEj2AoN3JwoJroRWIKn0S2GicSOwcgcDWgtGAKt4hizegsVYSia3bzRURs8NJP-KIj6X65fCz4WJf840GLT7XFkYkVsoJbSZ9Ge0K604-cVq6NdGP9VnFjUH59O_BI14x7hRPCZCnYU44jN9CDuhHcGHVw7WPBNED_-tbc734VeFIU3kMvSIxt4c7tN8vxirKeQcJpuYAwdKT-EhECa65uwXNyTj3Zr0e37sre-Z3CPWW5JbUekWqx61FFRpGlvOhZK9pGZLUlG7vcExue4bhgNlnJ3JBvmeV7f0i2GemSwfpWoeyi-PUrUP1a2-fxFMeKJ8B1nNv7oTWqPh6UTBetTw7TJTbm7EhBYoBB-gpwGXSFm0FAzpbKDV8Ffv-9faXApnkyZAWA_3D-N0sdFdqduyxQ11ohG8VK2s2s3Utaou-7aua05CU9-okiqshNS91HzU1cZ0ksuKl6IUbdXItqjEWDUl3_JG1WoUyCpORzS2WF3vw2Gzjopuq4RUG4s92fg2n3B4JqdZefcu2zqmQreeTr8cYr49Jqb4gZZMsuuAywIztftVpQijDx_ezILcTgYMlK_uuETSxWYJtvvfTlm7iUzu14b-CQAA__-03rm_">