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

    <tr>
        <th>Summary</th>
        <td>
            [DirectX backend] Support ConstantPointerNull in PointerTypeAnalysis
        </td>
    </tr>

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

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

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

<pre>
    
In PointerTypeAnalysis, we'll map Constant value with opaque ptr with a typed pointer type.

But ConstantPointerNull could be used for all kinds of nullptrs, map it to one typed pointer type will not work.

We cannot create bitcast to typed pointer type because it is illegal to use typed pointer type in llvm IR.
And we cannot create ConstantValue with typed pointer type for the same reason.

Maybe create ConstantStruct { ptr, i32 } with different i32 immediate value and save different typed ptr type to the ConstantStruct?



</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxtUl1v2zAM_DX2C7HAkWJ7efBD2qBYgW0Y1mHbK23RiRZZ8iS5Rf79KDtdPxDAkEyJvDse1Tp1brJinxW7ewvfnLaR_I_zSDuL5hx0yMQtPFEmamNgwBFunQ0RbYRHNBPBk45HcCP-5f8x-iVGiIygYFzg5mi1kCzrzRT_A104v05M0LnJKGgJpsDlvfOAfHrSVgVwPVjOYZJZU9KiI0QHztIVPlbCpdZFeHL-9Ib9F0GHNl11njAStDp2GGawK0Atdch6EpsOwKh0QJNy0-GVfG3BmMcB7r9fWHdWsYXvOJ_b__li4xWsZEE8EgQcCLgwOPumlS94ZrfeQT5EP3URsvomjSSZpaXgcL_QKN335IlHmI71MJDSqXwZKLLYgI_0Ku2iK140JZeO79kyefda17Lm1KyrSm7Lsq5krhqptnKLedTRUJOVN3vtqYu_ocXuRFZl5R4epnF0_vrr0FcfaD550xxjHEMmd5m44-_AbU7tqnMDB2kWl-3D6N0fZuRQhzARP6S7st5uRH5sqqrtieTHartGJTadKvp1WZUoN5JEiyo32JIJSXYmxLNiubv0wGfJaN4-fX74nKJyn-tGFEIUWyHXdVkVYqVU3aNslSqqTc1c2aagAbVZJXUr5w-5b2ah7XQIfGl0iOHlEkPQB0uzdwkfp3h0vhnPvFl5OiDlc1_N3NQ_rtBNew">