<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/clang/lib/CodeGen/CGHLSLBuiltins.cpp, branch main</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] Add Load overload with status (#166449)</title>
<updated>2025-11-21T18:11:38+00:00</updated>
<author>
<name>Joshua Batista</name>
<email>jbatista@microsoft.com</email>
</author>
<published>2025-11-21T18:11:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=fea070b610e0dc08447be60db7f13c150b2892d5'/>
<id>fea070b610e0dc08447be60db7f13c150b2892d5</id>
<content type='text'>
This PR adds a Load method for resources, which takes an additional
parameter by reference, status. It fills the status parameter with a 1
or 0, depending on whether or not the resource access was mapped.
CheckAccessFullyMapped is also added as an intrinsic, and called in the
production of this status bit.
Only addresses DXIL for the below issue:
https://github.com/llvm/llvm-project/issues/138910
Also only addresses the DXIL variant for the below issue:
https://github.com/llvm/llvm-project/issues/99204</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This PR adds a Load method for resources, which takes an additional
parameter by reference, status. It fills the status parameter with a 1
or 0, depending on whether or not the resource access was mapped.
CheckAccessFullyMapped is also added as an intrinsic, and called in the
production of this status bit.
Only addresses DXIL for the below issue:
https://github.com/llvm/llvm-project/issues/138910
Also only addresses the DXIL variant for the below issue:
https://github.com/llvm/llvm-project/issues/99204</pre>
</div>
</content>
</entry>
<entry>
<title>[HLSL] Implement ddx/ddy_coarse intrinsics (#164831)</title>
<updated>2025-11-18T15:41:07+00:00</updated>
<author>
<name>Alexander Johnston</name>
<email>alexander.javen.johnston@gmail.com</email>
</author>
<published>2025-11-18T15:41:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=ed60cd2563ca6ee474f76487857dd5fd56b83925'/>
<id>ed60cd2563ca6ee474f76487857dd5fd56b83925</id>
<content type='text'>
Closes https://github.com/llvm/llvm-project/issues/99097
Closes https://github.com/llvm/llvm-project/issues/99100

As ddx and ddy are near identical implementations I've combined them in
this PR. This aims to unblock
https://github.com/llvm/llvm-project/pull/161378

---------

Co-authored-by: Alexander Johnston &lt;alexander.johnston@amd.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Closes https://github.com/llvm/llvm-project/issues/99097
Closes https://github.com/llvm/llvm-project/issues/99100

As ddx and ddy are near identical implementations I've combined them in
this PR. This aims to unblock
https://github.com/llvm/llvm-project/pull/161378

---------

Co-authored-by: Alexander Johnston &lt;alexander.johnston@amd.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[HLSL] Implement the f16tof32() intrinsic (#165860)</title>
<updated>2025-11-04T17:04:39+00:00</updated>
<author>
<name>Tim Corringham</name>
<email>timothy.corringham@amd.com</email>
</author>
<published>2025-11-04T17:04:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=89ec96b8b4f4a3115689b045cd64afae1c28044e'/>
<id>89ec96b8b4f4a3115689b045cd64afae1c28044e</id>
<content type='text'>
Implement the f16tof32() intrinsic, including DXILand SPIRV codegen, and
associated tests.

Fixes #99112

---------

Co-authored-by: Tim Corringham &lt;tcorring@amd.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Implement the f16tof32() intrinsic, including DXILand SPIRV codegen, and
associated tests.

Fixes #99112

---------

Co-authored-by: Tim Corringham &lt;tcorring@amd.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[HLSL][DXIL][SPRIV] Added WaveActiveMin intrinsic (#164385)</title>
<updated>2025-10-28T18:01:13+00:00</updated>
<author>
<name>Sietze Riemersma</name>
<email>43845930+KungFuDonkey@users.noreply.github.com</email>
</author>
<published>2025-10-28T18:01:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=bfd4935fa3b47f552a0032d3e47c104924d1e107'/>
<id>bfd4935fa3b47f552a0032d3e47c104924d1e107</id>
<content type='text'>
Adds the WaveActiveMin intrinsic from #99169. I think I did all of the
required things on the checklist:
- [x]  Implement `WaveActiveMin` clang builtin,
- [x]  Link `WaveActiveMin` clang builtin with `hlsl_intrinsics.h`
- [x] Add sema checks for `WaveActiveMin` to
`CheckHLSLBuiltinFunctionCall` in `SemaChecking.cpp`
- [x] Add codegen for `WaveActiveMin` to `EmitHLSLBuiltinExpr` in
`CGBuiltin.cpp`
- [x] Add codegen tests to
`clang/test/CodeGenHLSL/builtins/WaveActiveMin.hlsl`
- [x] Add sema tests to
`clang/test/SemaHLSL/BuiltIns/WaveActiveMin-errors.hlsl`
- [x] Create the `int_dx_WaveActiveMin` intrinsic in
`IntrinsicsDirectX.td`
- [x] Create the `DXILOpMapping` of `int_dx_WaveActiveMin` to `119` in
`DXIL.td`
- [x] Create the `WaveActiveMin.ll` and `WaveActiveMin_errors.ll` tests
in `llvm/test/CodeGen/DirectX/`
- [x] Create the `int_spv_WaveActiveMin` intrinsic in
`IntrinsicsSPIRV.td`
- [x] In SPIRVInstructionSelector.cpp create the `WaveActiveMin`
lowering and map it to `int_spv_WaveActiveMin` in
`SPIRVInstructionSelector::selectIntrinsic`.
- [x] Create SPIR-V backend test case in
`llvm/test/CodeGen/SPIRV/hlsl-intrinsics/WaveActiveMin.ll

But as some of the code has changed and was moved around (E.G.
`CGBuiltin.cpp` -&gt; `CGHLSLBuiltins.cpp`) I mostly followed how
`WaveActiveMax()` is implemented.

I have not been able to run the tests myself as I am unsure which
project runs the correct test. Any guidance on how I can test myself
would be helpful.

Also added some tests to the offload-test-suite
https://github.com/llvm/offload-test-suite/pull/478</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Adds the WaveActiveMin intrinsic from #99169. I think I did all of the
required things on the checklist:
- [x]  Implement `WaveActiveMin` clang builtin,
- [x]  Link `WaveActiveMin` clang builtin with `hlsl_intrinsics.h`
- [x] Add sema checks for `WaveActiveMin` to
`CheckHLSLBuiltinFunctionCall` in `SemaChecking.cpp`
- [x] Add codegen for `WaveActiveMin` to `EmitHLSLBuiltinExpr` in
`CGBuiltin.cpp`
- [x] Add codegen tests to
`clang/test/CodeGenHLSL/builtins/WaveActiveMin.hlsl`
- [x] Add sema tests to
`clang/test/SemaHLSL/BuiltIns/WaveActiveMin-errors.hlsl`
- [x] Create the `int_dx_WaveActiveMin` intrinsic in
`IntrinsicsDirectX.td`
- [x] Create the `DXILOpMapping` of `int_dx_WaveActiveMin` to `119` in
`DXIL.td`
- [x] Create the `WaveActiveMin.ll` and `WaveActiveMin_errors.ll` tests
in `llvm/test/CodeGen/DirectX/`
- [x] Create the `int_spv_WaveActiveMin` intrinsic in
`IntrinsicsSPIRV.td`
- [x] In SPIRVInstructionSelector.cpp create the `WaveActiveMin`
lowering and map it to `int_spv_WaveActiveMin` in
`SPIRVInstructionSelector::selectIntrinsic`.
- [x] Create SPIR-V backend test case in
`llvm/test/CodeGen/SPIRV/hlsl-intrinsics/WaveActiveMin.ll

But as some of the code has changed and was moved around (E.G.
`CGBuiltin.cpp` -&gt; `CGHLSLBuiltins.cpp`) I mostly followed how
`WaveActiveMax()` is implemented.

I have not been able to run the tests myself as I am unsure which
project runs the correct test. Any guidance on how I can test myself
would be helpful.

Also added some tests to the offload-test-suite
https://github.com/llvm/offload-test-suite/pull/478</pre>
</div>
</content>
</entry>
<entry>
<title>[HLSL] GetDimensions methods for buffer resources (#161929)</title>
<updated>2025-10-17T19:09:34+00:00</updated>
<author>
<name>Helena Kotas</name>
<email>hekotas@microsoft.com</email>
</author>
<published>2025-10-17T19:09:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=024dd569223d00da55412bff8fffffebd1cb799b'/>
<id>024dd569223d00da55412bff8fffffebd1cb799b</id>
<content type='text'>
Adds `GetDimensions` methods to all supported buffer resource classes (`{RW}Buffer`, `*StructuredBuffer`, `{RW}ByteAddressBuffer`). The method is implemented by calling one of both built-in functions `__builtin_hlsl_resource_getdimensions_x` and `__builtin_hlsl_resource_getstride` as described in proposal https://github.com/llvm/wg-hlsl/pull/350.

The `__builtin_hlsl_resource_getstride` is implemented directly by Clang codegen by setting the buffer stride to the output variable.

The `__building_hlsl_buffer_getdimensions` built-in function gets translated to LLVM intrinsic `@llvm.dx.resource.getdimensions.x`.

Closes #112984</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Adds `GetDimensions` methods to all supported buffer resource classes (`{RW}Buffer`, `*StructuredBuffer`, `{RW}ByteAddressBuffer`). The method is implemented by calling one of both built-in functions `__builtin_hlsl_resource_getdimensions_x` and `__builtin_hlsl_resource_getstride` as described in proposal https://github.com/llvm/wg-hlsl/pull/350.

The `__builtin_hlsl_resource_getstride` is implemented directly by Clang codegen by setting the buffer stride to the output variable.

The `__building_hlsl_buffer_getdimensions` built-in function gets translated to LLVM intrinsic `@llvm.dx.resource.getdimensions.x`.

Closes #112984</pre>
</div>
</content>
</entry>
<entry>
<title>[SPIRV][HLSL] Add Sema and CodeGen for implicit typed buffer counters (#162291)</title>
<updated>2025-10-09T16:30:58+00:00</updated>
<author>
<name>Steven Perron</name>
<email>stevenperron@google.com</email>
</author>
<published>2025-10-09T16:30:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=ec15cdfb328c504298d0ab14e287448804e6bea5'/>
<id>ec15cdfb328c504298d0ab14e287448804e6bea5</id>
<content type='text'>
This commit implements the Sema and CodeGen portions of the typed buffer
counter proposal described in the HLSL WG proposal 0023.

This change introduces the necessary Sema and CodeGen logic to handle
implicit counter variables for typed buffers. This includes:

- Extending `HLSLResourceBindingAttr` to store the implicit counter
  binding order ID.
- Introducing the
`__builtin_hlsl_resource_counterhandlefromimplicitbinding`
  builtin.
- Updating `SemaHLSL` to correctly initialize global resource
declarations
  and resource arrays with implicit counter buffers.
- Adding CodeGen support for the new builtin, which generates a
  `llvm.spv.resource.counterhandlefromimplicitbinding` intrinsic for the
SPIR-V target and aliases the main resource handle for the DXIL target.
- Adding and updating tests to verify the new functionality.

Fixes #137032</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit implements the Sema and CodeGen portions of the typed buffer
counter proposal described in the HLSL WG proposal 0023.

This change introduces the necessary Sema and CodeGen logic to handle
implicit counter variables for typed buffers. This includes:

- Extending `HLSLResourceBindingAttr` to store the implicit counter
  binding order ID.
- Introducing the
`__builtin_hlsl_resource_counterhandlefromimplicitbinding`
  builtin.
- Updating `SemaHLSL` to correctly initialize global resource
declarations
  and resource arrays with implicit counter buffers.
- Adding CodeGen support for the new builtin, which generates a
  `llvm.spv.resource.counterhandlefromimplicitbinding` intrinsic for the
SPIR-V target and aliases the main resource handle for the DXIL target.
- Adding and updating tests to verify the new functionality.

Fixes #137032</pre>
</div>
</content>
</entry>
<entry>
<title>Implements isnan() HLSL intrinsic for DXIL and SPIR-V targets. (#157733)</title>
<updated>2025-09-25T16:34:47+00:00</updated>
<author>
<name>Dan Brown</name>
<email>61992655+danbrown-amd@users.noreply.github.com</email>
</author>
<published>2025-09-25T16:34:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=df420ee2ba3ce58b07f7ae70b32ebd649dcb0a5a'/>
<id>df420ee2ba3ce58b07f7ae70b32ebd649dcb0a5a</id>
<content type='text'>
Addresses #99132.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Addresses #99132.</pre>
</div>
</content>
</entry>
<entry>
<title>[HLSL] NonUniformResourceIndex implementation (#160430)</title>
<updated>2025-09-24T17:07:30+00:00</updated>
<author>
<name>Helena Kotas</name>
<email>hekotas@microsoft.com</email>
</author>
<published>2025-09-24T17:07:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=2bf3748eeabf6e963adf2ab48b158438f4774bbc'/>
<id>2bf3748eeabf6e963adf2ab48b158438f4774bbc</id>
<content type='text'>
Adds HLSL function `NonUniformResourceIndex` to `hlsl_intrinsics.h.` The function calls a builtin `__builtin_hlsl_resource_nonuniformindex` which gets translated to LLVM intrinsic `llvm.{dx|spv}.resource_nonuniformindex`.

Closes #157923</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Adds HLSL function `NonUniformResourceIndex` to `hlsl_intrinsics.h.` The function calls a builtin `__builtin_hlsl_resource_nonuniformindex` which gets translated to LLVM intrinsic `llvm.{dx|spv}.resource_nonuniformindex`.

Closes #157923</pre>
</div>
</content>
</entry>
<entry>
<title>[HLSL][DirectX] Fix resource lowering when using structs with `select` (#158361)</title>
<updated>2025-09-15T19:54:11+00:00</updated>
<author>
<name>Kaitlin Peng</name>
<email>kaitlinpeng@microsoft.com</email>
</author>
<published>2025-09-15T19:54:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a32d88b79abaaab46cb1580d75df7422d0a9e4d3'/>
<id>a32d88b79abaaab46cb1580d75df7422d0a9e4d3</id>
<content type='text'>
Fixes #156550.

The `select` instruction should be using the struct values themselves
rather than pointers to temporary allocas.
This PR also adds an array test for select in `select.hlsl`.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes #156550.

The `select` instruction should be using the struct values themselves
rather than pointers to temporary allocas.
This PR also adds an array test for select in `select.hlsl`.</pre>
</div>
</content>
</entry>
<entry>
<title>[HLSL] Reorder arguments of __builtin_hlsl_resource_handlefromimplicitbinding (#155861)</title>
<updated>2025-09-04T00:30:36+00:00</updated>
<author>
<name>Helena Kotas</name>
<email>hekotas@microsoft.com</email>
</author>
<published>2025-09-04T00:30:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=aa02206fcd7ff5ff04a1c04fad9d1507cece1168'/>
<id>aa02206fcd7ff5ff04a1c04fad9d1507cece1168</id>
<content type='text'>
Reorder the arguments of `__builtin_hlsl_resource_handlefromimplicitbinding` builtins to match the order of the `llvm.dx.resource.handlefromimplicitbinding` intrinsics, and also to match the arguments on the static create methods
for resource initialization ([described here](https://github.com/llvm/wg-hlsl/pull/336)).

Previously the arguments were in the same order as the resource class constructor for implicit binding. The `orderId` argument was intentionally at index `3` to make sure explicit &amp; implicit binding constructors have different signature. Since we are going to replace the constructors that have binding info with static create methods, this is no longer necessary, and it is better for the argument order to match.

Related to #154221.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reorder the arguments of `__builtin_hlsl_resource_handlefromimplicitbinding` builtins to match the order of the `llvm.dx.resource.handlefromimplicitbinding` intrinsics, and also to match the arguments on the static create methods
for resource initialization ([described here](https://github.com/llvm/wg-hlsl/pull/336)).

Previously the arguments were in the same order as the resource class constructor for implicit binding. The `orderId` argument was intentionally at index `3` to make sure explicit &amp; implicit binding constructors have different signature. Since we are going to replace the constructors that have binding info with static create methods, this is no longer necessary, and it is better for the argument order to match.

Related to #154221.</pre>
</div>
</content>
</entry>
</feed>
