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

    <tr>
        <th>Summary</th>
        <td>
            Introduce llvm.dx.handle.fromBinding intrinsic and lowering
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

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

<pre>
    When creating handles from binding information in llvm we'll represent it with a `llvm.dx.handle.fromBinding` intrinsic that creates a target type. There's more information in #90553 but generally this will look something like so:

```llvm
; RWBuffer<float4> Buf : register(u5, space3)
%buf = call target("dx.Buffer", <4 x float>, 1, 0)
            @llvm.dx.handle.fromBinding.tdx.Buffer_v4f32_1_0(
 i32 3, i32 5, i32 1, i32 0, i1 false)
```

This will need to be lowered to either `createHandle` or `createHandleFromBinding` + `annotateHandle` dxil operations depending on the shader model, as well as the dxil metadata for resource binding.

## Acceptance Criteria
- The llvm intrinsic and dxil operation are defined
- Emitting dxil will translate the llvm intrinsic to the appropriate dxil op(s) and metadata
- Pre-SM6.6 DXIL and post are both handled.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx8VFFvpDYQ_jXmZRQENrDLAw_ZJKue1EpVe9L1LTJ4APeMjezhNvn3lc1uckmrrlZgxjPffDP-xjIEPVnEjtUnVj9mcqPZ-a53k0Wf9U69dt9mtDB4lKTtBLO0ymCA0bsFem1VNGo7Or9I0s6CtmDMjwUuyPjBGPC4egxoCTTBRdMMElhTRJ9cveQ7Xh7hTjsaawrQlry2QQ9As6Q9OwaQQNJPSECvK-bwdUYfswRYnMfPLBgXbVHXAvqNYEKLXhrzCjTrABdtDBjnvkNwC9IcizD6O0JwTNyz4pEVt2dT7P9I-GoSJ_jj22kbR_RMPIzGSaqYeILTNgIT9-Bx0oHQM37casYfIKxyQMF4ewXgdZ9cH2GQxlyLYvzIOFcv-RWZ8xjKxEMFL5CSMPEUTWV8FG9o8NOPVf_T2JzewJ9_VKPgz-VzEbPuMFpwEBE6LurborwtirQoYZQm4Hspt_b83LOvby22iArIQY9g3AX9_oWaZvRRBfvB_pKoxnN3_7KePwqD8VP0kNY6-hCpXrQBt6JP5x9A4Yq7OJ0FmhHCLBV6WJxCE0uRAS5oTHzH7RS_IEklScLoPHgMbvMD3lSef5AFF4wLuB8GXEnaAeHBa0Kv5b5_F8W5D8K7lqVVn3iC9AgKR21R3QKfFk1p1JJraiN5aYORhInqJ1RyySrX1bvV6-h1TcL4MTDepry30m5Zfvd49-dvTd7A419ffk0uqwuUCPWO5uugqzxTnVCtaGWGXXko67KoquaYzd2hHYahUo081KIsx2Nf1_VY90LJZjzi2Ga64wWviro4lIe64sdcYauGXhyH9jAMx_rAqgIXqU2eNOv8lOkQNuzaUjRNZmSPJqSLiXOLF0ibcSzqx8x3Meau36YQNa8DhXcU0mSw-2LJO7UNe8P-eyQ-HU7SqLZTtnnTzURriLcBPzN-njTNW58PbmH8nO6C_XW3evc3DsT4OfELjJ8T_38CAAD__50huo8">