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

    <tr>
        <th>Summary</th>
        <td>
            [DirectX] Add API to find a resource binding given a use of a resource
        </td>
    </tr>

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

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

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

<pre>
    There are times when we need to determine what unique resource we have given a use of a resource type (such as #114130). The full scope of doing this is tracked in #125126, but the entire scope of that task isn't practical until we support heap and library resources.

In the meantime, we should implement an API in DXIL resource analysis that, given a `Value *` that is a use of a resource type, walks defs until it finds a call to the llvm.dx.resource.handlefrombinding intrinsic and looks up that binding in the DXILBindingMap. The expectation is that this API would be trivially modifiable with the more generic resource lookup once #125126 is done.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJx0U82O4zYMfhr5Qqxhyz9JDj5kOwiwQAv0sCj2Slt0zI4suRKVbN6-kDPT9LInAwY_fn8ixshXRzSo7qvq3gpMsvgwjP7qKBSjN4_h-0KBAAOB8EoR7gs5uBM4IgPiwZBQWNkR3BcUSI7_SQSBok9hojy54I3gyjdygJAigZ8BXxPy2AiUPsY0LYARlG7quq2bSulTCd8XgjlZC3Hy2w41nt0VZOEIHEECTu9kgN0O1F2te6V_gzEJyEJATjjQCy1ZpGB8B45O6YPAFnASntBCcsI2K45p23wQWAg3QGfA8hgwPP4THUtVnVV1_uZ2kpXQ5XQycYYvPlkDvG6WVnIC6OD857es8e3Ht99f1tGhfcTsYkHJ4M-UVF_9hTblXM6qr56qOf4yv50Y7XsEQ3P8MMICMzuTURNam8vKYq29raX5WX4uKBd0xtIc_DqyMzlcdhLYRZ6e5r1_j5C2p4rXzL4tG_r6_PUHbs--6OdGk6Cwd_Bh7tlXDuG-ZzMSSOAbo7UPWL3hmXG0BHeW5RmpDwRXchR4ennNUtIG3k30qjtzGO-oLMzQmFNzwoKG-tAc-1Nf91WxDFM11ydz7KbuiPpU4djUzbGbe8K6qw6tLnjQle4qXbX1qTrpqpy7o27NodV9i7OuatVWtCLbck_Ph2vBMSYaat0d2r6wOJKN-xVpPeYX6Yxqzm8caJIfSut8XGHI4C9jukbVVpajxNc6YbH7GX5iujc4G7NHJn4v8v-lf7bwy7MqUrDDIrJF1ZyVvih9ubIsaSwnvyp9ycQfny9b8H_TJEpfdlNR6cuHr9ug_w0AAP__WwFmPQ">