[llvm] [DirectX] Add support for implicit binding to DXILForwardHandleAccesses pass (PR #142061)

Helena Kotas via llvm-commits llvm-commits at lists.llvm.org
Thu May 29 18:58:42 PDT 2025


================
@@ -18,8 +18,8 @@ entry:
   store target("dx.RawBuffer", <4 x float>, 1, 0) %_ZL2In_h.i.i, ptr @_ZL2In, align 4
   store ptr @_ZL2In, ptr %this.addr.i.i, align 4
   %this1.i.i = load ptr, ptr %this.addr.i.i, align 4
-  ; CHECK: [[OUT:%.*]] = call target("dx.RawBuffer", <4 x float>, 1, 0) @llvm.dx.resource.handlefrombinding.tdx.RawBuffer_v4f32_1_0t(i32 0, i32 1, i32 1, i32 0, i1 false, ptr null)
-  %_ZL3Out_h.i.i = call target("dx.RawBuffer", <4 x float>, 1, 0) @llvm.dx.resource.handlefrombinding.tdx.RawBuffer_v4f32_1_0t(i32 0, i32 1, i32 1, i32 0, i1 false, ptr null)
+  ; CHECK: [[OUT:%.*]] = call target("dx.RawBuffer", <4 x float>, 1, 0) @llvm.dx.resource.handlefromimplicitbinding.tdx.RawBuffer_v4f32_1_0t(i32 100, i32 0, i32 1, i32 0, i1 false, ptr null)
+  %_ZL3Out_h.i.i = call target("dx.RawBuffer", <4 x float>, 1, 0) @llvm.dx.resource.handlefromimplicitbinding.tdx.RawBuffer_v4f32_1_0t(i32 100, i32 0, i32 1, i32 0, i1 false, ptr null)
----------------
hekota wrote:

I changed the first argument from 0 to 100 because it has a different meaning, though it was not strictly necessary. In `handlefrombinding` the first argument is a register slot number. In `handlefromimplicitbinding` the first argument is a unique identifier of the resource that is used for implicit binding assignment later on and that reflect the order in which the resource has been declared (implicit bindings must be assigned in declaration order).

https://github.com/llvm/llvm-project/pull/142061


More information about the llvm-commits mailing list