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

    <tr>
        <th>Summary</th>
        <td>
            [DirectX] Split DXILResourceAnalysis into one analysis for types and another for bindings
        </td>
    </tr>

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

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

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

<pre>
    Currently DXILResourceAnalysis gathers information about resources and their bindings, but we should split this into an analysis that tells us about resource types and a separate one that depends on the first and maps the bindings. This originated from [a comment](https://github.com/llvm/llvm-project/pull/112798#issuecomment-2508286754) on a PR that was trying to use this analysis, but also affects a few other places.

The resource type analysis can be immutable/preservedWhenStateless, so we can resolve [Farzon's concerns in #116726](https://github.com/llvm/llvm-project/pull/116726#discussion_r1857338744). The bindings analysis can run later so it isn't so hard to preserve.

### Acceptance Criteria / Follow ups

After we've done this, we should be able to follow up in a few areas:
- Rebase llvm/llvm-project#116726 and adapt to just use resource handle types 
- Simplify llvm/llvm-project#112798 - we should need to resource use map at all, but preserving the bindings analysis is still useful.
- Move the complicated parts of llvm/llvm-project#116845 to DXILResourceAccess. We can keep lowering simple here.

We may also be able to implement llvm/llvm-project#114557 using resource handle types, but since the flags analysis is currently happening after op lowering this may be less relevant there.

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykVd2K4zgTfRrlpuhgy3F-LnyRmSbwwbewTA_03C1lqRxrRpaMSk7IPv0iOe6foftiWQgEC9WpU6dOlZDZnB1RI-ovQsrWnx0FIaWoH1c4xd6HZj5btV7fmq9TCOSivcHjj__9_xuxn4Kio0N7Y8NwxthTYDCu82HAaLwDbP0UIdyvMqDTEHsyAVrjtHFnFvIrtFOEKwH3frIaeLQmQuxNgooe0AEuOWKPESJZyzDxb-gQb-M9BQLTiAEjgXc0R2kayWkG7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