<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/clang/lib/CodeGen/CGHLSLBuiltins.cpp, branch users/nico/python-1</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>[HLSL] Don't use CreateRuntimeFunction for intrinsics (#145334)</title>
<updated>2025-06-23T15:37:33+00:00</updated>
<author>
<name>Nikita Popov</name>
<email>npopov@redhat.com</email>
</author>
<published>2025-06-23T15:37:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=1128a4fd2c3a70ba61eead2ce093a9c31aa2970e'/>
<id>1128a4fd2c3a70ba61eead2ce093a9c31aa2970e</id>
<content type='text'>
HLSL uses CreateRuntimeFunction for three intrinsics. This is pretty
unusual thing to do, and doesn't match what the rest of the file does.

I suspect this might be because these are convergent calls, but the
intrinsics themselves are already marked convergent, so it's not
necessary for clang to manually add the attribute.

This does lose the spir_func CC on the intrinsic declaration, but again,
CC should not be relevant to intrinsics at all.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
HLSL uses CreateRuntimeFunction for three intrinsics. This is pretty
unusual thing to do, and doesn't match what the rest of the file does.

I suspect this might be because these are convergent calls, but the
intrinsics themselves are already marked convergent, so it's not
necessary for clang to manually add the attribute.

This does lose the spir_func CC on the intrinsic declaration, but again,
CC should not be relevant to intrinsics at all.</pre>
</div>
</content>
</entry>
<entry>
<title>[HLSL][SPIRV] Reapply "[HLSL][SPIRV] Add vk::constant_id attribute." (#144902)</title>
<updated>2025-06-19T15:52:55+00:00</updated>
<author>
<name>Steven Perron</name>
<email>stevenperron@google.com</email>
</author>
<published>2025-06-19T15:52:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=01d648a42939c834b6b45677e540882222b01c11'/>
<id>01d648a42939c834b6b45677e540882222b01c11</id>
<content type='text'>
- **Reapply "[HLSL][SPIRV] Add vk::constant_id attribute." (#144812)**
- **Fix memory leak.**</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- **Reapply "[HLSL][SPIRV] Add vk::constant_id attribute." (#144812)**
- **Fix memory leak.**</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[HLSL][SPIRV] Add vk::constant_id attribute." (#144812)</title>
<updated>2025-06-18T23:30:43+00:00</updated>
<author>
<name>Steven Perron</name>
<email>stevenperron@google.com</email>
</author>
<published>2025-06-18T23:30:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=5f69d680e2cc94dcb30a7f29e8144725530a6da4'/>
<id>5f69d680e2cc94dcb30a7f29e8144725530a6da4</id>
<content type='text'>
Reverts llvm/llvm-project#143544</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reverts llvm/llvm-project#143544</pre>
</div>
</content>
</entry>
<entry>
<title>[HLSL][SPIRV] Add vk::constant_id attribute. (#143544)</title>
<updated>2025-06-18T10:39:52+00:00</updated>
<author>
<name>Steven Perron</name>
<email>stevenperron@google.com</email>
</author>
<published>2025-06-18T10:39:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=acde20b5605f3a3a8da2217e4526fc045e6603ed'/>
<id>acde20b5605f3a3a8da2217e4526fc045e6603ed</id>
<content type='text'>
The vk::constant_id attribute is used to indicate that a global const
variable
represents a specialization constant in SPIR-V. This PR adds this
attribute to clang.

The documentation for the attribute is
[here](https://github.com/microsoft/DirectXShaderCompiler/blob/main/docs/SPIR-V.rst#specialization-constants).

The strategy is to to modify the initializer to get the value of a
specialize constant for a builtin defined in the SPIR-V backend.

Implements https://github.com/llvm/wg-hlsl/pull/287

Fixes https://github.com/llvm/llvm-project/issues/142448

---------

Co-authored-by: Nathan Gauër &lt;github@keenuts.net&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The vk::constant_id attribute is used to indicate that a global const
variable
represents a specialization constant in SPIR-V. This PR adds this
attribute to clang.

The documentation for the attribute is
[here](https://github.com/microsoft/DirectXShaderCompiler/blob/main/docs/SPIR-V.rst#specialization-constants).

The strategy is to to modify the initializer to get the value of a
specialize constant for a builtin defined in the SPIR-V backend.

Implements https://github.com/llvm/wg-hlsl/pull/287

Fixes https://github.com/llvm/llvm-project/issues/142448

---------

Co-authored-by: Nathan Gauër &lt;github@keenuts.net&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[HLSL][SPIRV] Use resource names (#143412)</title>
<updated>2025-06-13T16:21:38+00:00</updated>
<author>
<name>Steven Perron</name>
<email>stevenperron@google.com</email>
</author>
<published>2025-06-13T16:21:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=bd33eef7f1013bea24289a898f788a2efe9d8282'/>
<id>bd33eef7f1013bea24289a898f788a2efe9d8282</id>
<content type='text'>
The SPIR-V backend does not have access to the original name of a
resource in the source, so it tries to create a name. This leads to some
problems with reflection.
    
That is why start to pass the name of the resource from Clang to the
SPIR-V backend.
    
Fixes #138533</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The SPIR-V backend does not have access to the original name of a
resource in the source, so it tries to create a name. This leads to some
problems with reflection.
    
That is why start to pass the name of the resource from Clang to the
SPIR-V backend.
    
Fixes #138533</pre>
</div>
</content>
</entry>
<entry>
<title>[HLSL] Add WaveGetLaneCount() intrinsic to FE (#143127)</title>
<updated>2025-06-10T12:25:09+00:00</updated>
<author>
<name>Nathan Gauër</name>
<email>brioche@google.com</email>
</author>
<published>2025-06-10T12:25:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=6582d7d348c14b0e8be98d651b5d6e49d20beedb'/>
<id>6582d7d348c14b0e8be98d651b5d6e49d20beedb</id>
<content type='text'>
This commit adds code to lower WaveGetLaneCount() into the SPV or DXIL
intrinsic. The backends will then need to lower the intrinsic into
proper SPIR-V/DXIL.

Related to #99159</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit adds code to lower WaveGetLaneCount() into the SPV or DXIL
intrinsic. The backends will then need to lower the intrinsic into
proper SPIR-V/DXIL.

Related to #99159</pre>
</div>
</content>
</entry>
<entry>
<title>[DirectX] Add resource name argument to llvm.dx.handlefrom[implicit]binding intrinsics (#139991)</title>
<updated>2025-05-28T05:57:01+00:00</updated>
<author>
<name>Helena Kotas</name>
<email>hekotas@microsoft.com</email>
</author>
<published>2025-05-28T05:57:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=27675ccdd6315b560f5f90db34f6a4520fa26b6b'/>
<id>27675ccdd6315b560f5f90db34f6a4520fa26b6b</id>
<content type='text'>
Adds resource name argument to `llvm.dx.handlefrombinding` and `llvm.dx.handlefromimplicitbinding` intrinsics.
SPIR-V currently does not seem to need the resource names so this change only affects DirectX binding intrinsics.

Part 2/4 of https://github.com/llvm/llvm-project/issues/105059</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Adds resource name argument to `llvm.dx.handlefrombinding` and `llvm.dx.handlefromimplicitbinding` intrinsics.
SPIR-V currently does not seem to need the resource names so this change only affects DirectX binding intrinsics.

Part 2/4 of https://github.com/llvm/llvm-project/issues/105059</pre>
</div>
</content>
</entry>
<entry>
<title>[HLSL] Update Sema Checking Diagnostics for builtins (#138429)</title>
<updated>2025-05-21T20:03:07+00:00</updated>
<author>
<name>Sarah Spall</name>
<email>sarahspall@microsoft.com</email>
</author>
<published>2025-05-21T20:03:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=5ba57a81f213f17547be11e199888d8d156ececc'/>
<id>5ba57a81f213f17547be11e199888d8d156ececc</id>
<content type='text'>
Update how Sema Checking is done for HLSL builtins to allow for better
error messages, mainly using 'err_builtin_invalid_arg_type'.
Try to follow the formula outlined in issue #134721 
Closes #134721</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Update how Sema Checking is done for HLSL builtins to allow for better
error messages, mainly using 'err_builtin_invalid_arg_type'.
Try to follow the formula outlined in issue #134721 
Closes #134721</pre>
</div>
</content>
</entry>
<entry>
<title>[DirectX][SPIRV] Fix the lowering of dot4add (#140315)</title>
<updated>2025-05-17T17:38:24+00:00</updated>
<author>
<name>Justin Bogner</name>
<email>mail@justinbogner.com</email>
</author>
<published>2025-05-17T17:38:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=f695c8d529eae4b8cf6583bdd02824d24c47b0b0'/>
<id>f695c8d529eae4b8cf6583bdd02824d24c47b0b0</id>
<content type='text'>
There were some issues with these ops:
- The overload wasn't being specified (`dx.op.dot4AddPacked` vs
`dx.op.dot4AddPacked.i32`)
- The versioning wasn't correct (These ops were added in SM 6.4)
- The argument order was off - while the HLSL function has the
accumulator as the last argument, the DXIL op lists it first.

This fixes the DXIL.td definition and adjusts the LLVM DX and SPIRV
intrinsics to match the argument order in DXIL rather than the argument
order in HLSL.

Fixes #139018</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There were some issues with these ops:
- The overload wasn't being specified (`dx.op.dot4AddPacked` vs
`dx.op.dot4AddPacked.i32`)
- The versioning wasn't correct (These ops were added in SM 6.4)
- The argument order was off - while the HLSL function has the
accumulator as the last argument, the DXIL op lists it first.

This fixes the DXIL.td definition and adjusts the LLVM DX and SPIRV
intrinsics to match the argument order in DXIL rather than the argument
order in HLSL.

Fixes #139018</pre>
</div>
</content>
</entry>
<entry>
<title>[HLSL] Add resource constructor with implicit binding for global resources (#138976)</title>
<updated>2025-05-15T01:41:17+00:00</updated>
<author>
<name>Helena Kotas</name>
<email>hekotas@microsoft.com</email>
</author>
<published>2025-05-15T01:41:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=520773b47eba0df02730b929df073e1a38474bae'/>
<id>520773b47eba0df02730b929df073e1a38474bae</id>
<content type='text'>
Adds constructor for resources with implicit binding and applies it to
all resources without binding at the global scope.
Adds Clang builtin function
`__builtin_hlsl_resource_handlefromimplicitbinding` that gets translated
to `llvm.dx|spv.resource.handlefromimplicitbinding` intrinsic calls.
Specific bindings are assigned in DXILResourceImplicitBinding pass.

Design proposals:

https://github.com/llvm/wg-hlsl/blob/main/proposals/0024-implicit-resource-binding.md

https://github.com/llvm/wg-hlsl/blob/main/proposals/0025-resource-constructors.md

One change from the proposals is that the `orderId` parameter is added
onto the constructor. Originally it was supposed to be generated in
codegen when the `llvm.dx|spv.resource.handlefromimplicitbinding` call
is emitted, but that is not possible because the call is inside a
constructor, and the constructor body is generated once per resource
type and not resource instance. So the only way to inject instance-based
data like `orderId` into the
`llvm.dx|spv.resource.handlefromimplicitbinding` call is that it must
come in via the constructor argument.

Closes #136784</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Adds constructor for resources with implicit binding and applies it to
all resources without binding at the global scope.
Adds Clang builtin function
`__builtin_hlsl_resource_handlefromimplicitbinding` that gets translated
to `llvm.dx|spv.resource.handlefromimplicitbinding` intrinsic calls.
Specific bindings are assigned in DXILResourceImplicitBinding pass.

Design proposals:

https://github.com/llvm/wg-hlsl/blob/main/proposals/0024-implicit-resource-binding.md

https://github.com/llvm/wg-hlsl/blob/main/proposals/0025-resource-constructors.md

One change from the proposals is that the `orderId` parameter is added
onto the constructor. Originally it was supposed to be generated in
codegen when the `llvm.dx|spv.resource.handlefromimplicitbinding` call
is emitted, but that is not possible because the call is inside a
constructor, and the constructor body is generated once per resource
type and not resource instance. So the only way to inject instance-based
data like `orderId` into the
`llvm.dx|spv.resource.handlefromimplicitbinding` call is that it must
come in via the constructor argument.

Closes #136784</pre>
</div>
</content>
</entry>
</feed>
