<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/clang/test/AST/HLSL/StructuredBuffers-AST.hlsl, 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][TableGen] Add `__hlsl_resource_t` to known built-in function types (#163465)</title>
<updated>2025-11-19T22:56:49+00:00</updated>
<author>
<name>Helena Kotas</name>
<email>hekotas@microsoft.com</email>
</author>
<published>2025-11-19T22:56:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=19fe9b477b570fd395a161638c59e66b35d1a9ac'/>
<id>19fe9b477b570fd395a161638c59e66b35d1a9ac</id>
<content type='text'>
This change adds resource handle type `__hlsl_resource_t` to the list of types recognized in the Clang's built-in functions prototype string.

HLSL has built-in resource classes and some of them have many methods, such as
[Texture2D](https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/sm5-object-texture2d).
Most of these methods will be implemented by built-in functions that will take resource handle as an argument. This change enables us to move from generic `void(...)` prototype string for these methods and explicit argument checking in `SemaHLSL.cpp` to a prototype string with explicit argument types. Argument checking in `SemaHLSL.cpp` can be reduced to handle just the rules that cannot be expressed in the prototype string (for example verifying that the offset value in `__builtin_hlsl_buffer_update_counter` is `1` or `-1`).

In order to make this work, we now allow conversions from attributed resource handle type such as `__hlsl_resource_t [[hlsl::resource_class(UAV)]] [[hlsl::contained_type(float)]]` to a plain non-attributed `__hlsl_resource_t` type.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This change adds resource handle type `__hlsl_resource_t` to the list of types recognized in the Clang's built-in functions prototype string.

HLSL has built-in resource classes and some of them have many methods, such as
[Texture2D](https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/sm5-object-texture2d).
Most of these methods will be implemented by built-in functions that will take resource handle as an argument. This change enables us to move from generic `void(...)` prototype string for these methods and explicit argument checking in `SemaHLSL.cpp` to a prototype string with explicit argument types. Argument checking in `SemaHLSL.cpp` can be reduced to handle just the rules that cannot be expressed in the prototype string (for example verifying that the offset value in `__builtin_hlsl_buffer_update_counter` is `1` or `-1`).

In order to make this work, we now allow conversions from attributed resource handle type such as `__hlsl_resource_t [[hlsl::resource_class(UAV)]] [[hlsl::contained_type(float)]]` to a plain non-attributed `__hlsl_resource_t` type.</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>[HLSL] [SPIR-V] Add counter member for typed buffer (#161414)</title>
<updated>2025-10-02T17:47:28+00:00</updated>
<author>
<name>Steven Perron</name>
<email>stevenperron@google.com</email>
</author>
<published>2025-10-02T17:47:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=67c000efb7bb7858f9fb6e577f2c9d1f24291ba0'/>
<id>67c000efb7bb7858f9fb6e577f2c9d1f24291ba0</id>
<content type='text'>
This is part 1 of implementing the typed buffer counters proposal:

https://github.com/llvm/wg-hlsl/blob/main/proposals/0023-typed-buffer-counters.md

This patch adds the initial plumbing for supporting counter variables
associated with structured buffers for the SPIR-V backend. It introduces
an `IsCounter` attribute to `HLSLAttributedResourceType` and threads it
through the AST, type printing, and mangling. It also adds a
`__counter_handle` member to the relevant buffer types in
`HLSLBuiltinTypeDeclBuilder`.

Contributes to https://github.com/llvm/llvm-project/issues/137032</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is part 1 of implementing the typed buffer counters proposal:

https://github.com/llvm/wg-hlsl/blob/main/proposals/0023-typed-buffer-counters.md

This patch adds the initial plumbing for supporting counter variables
associated with structured buffers for the SPIR-V backend. It introduces
an `IsCounter` attribute to `HLSLAttributedResourceType` and threads it
through the AST, type printing, and mangling. It also adds a
`__counter_handle` member to the relevant buffer types in
`HLSLBuiltinTypeDeclBuilder`.

Contributes to https://github.com/llvm/llvm-project/issues/137032</pre>
</div>
</content>
</entry>
<entry>
<title>[HLSL] Remove resource constructors with binding (#157008)</title>
<updated>2025-09-17T16:56:48+00:00</updated>
<author>
<name>Helena Kotas</name>
<email>hekotas@microsoft.com</email>
</author>
<published>2025-09-17T16:56:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=087f4fc91b9665dced0007f82a38a0ddb0be79fd'/>
<id>087f4fc91b9665dced0007f82a38a0ddb0be79fd</id>
<content type='text'>
Removes resource constructors that take binding information per proposal update https://github.com/llvm/wg-hlsl/pull/336. The constructors are replaced by static `__createFromBinding` and `__createFromImplicitBinding` methods on the resource class.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Removes resource constructors that take binding information per proposal update https://github.com/llvm/wg-hlsl/pull/336. The constructors are replaced by static `__createFromBinding` and `__createFromImplicitBinding` methods on the resource class.</pre>
</div>
</content>
</entry>
<entry>
<title>[HLSL] Add static methods for resource initialization (#155866)</title>
<updated>2025-09-10T18:15:23+00:00</updated>
<author>
<name>Helena Kotas</name>
<email>hekotas@microsoft.com</email>
</author>
<published>2025-09-10T18:15:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=0d404509be903f7a6bf62ea9f9cff4cfca893651'/>
<id>0d404509be903f7a6bf62ea9f9cff4cfca893651</id>
<content type='text'>
Adds static methods `__createFromBinding` and `__createFromImplicitBinding` to resource classes. These methods will be
used for resource initialization instead of resource constructors that take binding information.

Updated proposal: https://github.com/llvm/wg-hlsl/pull/336
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Adds static methods `__createFromBinding` and `__createFromImplicitBinding` to resource classes. These methods will be
used for resource initialization instead of resource constructors that take binding information.

Updated proposal: https://github.com/llvm/wg-hlsl/pull/336
</pre>
</div>
</content>
</entry>
<entry>
<title>[HLSL] Add copy assignment and construtor to resource types (#156075)</title>
<updated>2025-09-06T11:50:03+00:00</updated>
<author>
<name>Steven Perron</name>
<email>stevenperron@google.com</email>
</author>
<published>2025-09-06T11:50:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=54ed459e3ed83bcc6570b885e9c9e65ab65dae75'/>
<id>54ed459e3ed83bcc6570b885e9c9e65ab65dae75</id>
<content type='text'>
The wrapper used to hold the handle for resource type has just the
default copy constructor and assignment operator. This causes clang to
insert memcpys when it does an assignment of a resource type. The
memcpy then cause optimizations to fail when the memcpy is turned into a
load and store of an i64.

To fix this, we should define copying of a resource type by adding the
operator= and copy constructor.

Partially fixes #154669</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The wrapper used to hold the handle for resource type has just the
default copy constructor and assignment operator. This causes clang to
insert memcpys when it does an assignment of a resource type. The
memcpy then cause optimizations to fail when the memcpy is turned into a
load and store of an i64.

To fix this, we should define copying of a resource type by adding the
operator= and copy constructor.

Partially fixes #154669</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>
<entry>
<title>[clang] fix regression printing constructor/destructor names (#155688)</title>
<updated>2025-08-27T21:04:55+00:00</updated>
<author>
<name>Matheus Izvekov</name>
<email>mizvekov@gmail.com</email>
</author>
<published>2025-08-27T21:04:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=0e3319537972d284e94a183899f15b40a798fd1f'/>
<id>0e3319537972d284e94a183899f15b40a798fd1f</id>
<content type='text'>
This makes the type printer not qualify constructor and destructor
names. These are represented as canonical types and the type printer is
used, but unlike canonical types which we normally print as fully
qualified, the expected behaviour for declaration names is for them to
be unqualified.

Note that this restores the behaviour pre #147835, but that is still
broken for the constructor names of class templates, since in that case
the injected class name type is used, but here the type printer is
configured to also print the implicit template arguments.

No release notes since this regression was never released.

Fixes #155537</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This makes the type printer not qualify constructor and destructor
names. These are represented as canonical types and the type printer is
used, but unlike canonical types which we normally print as fully
qualified, the expected behaviour for declaration names is for them to
be unqualified.

Note that this restores the behaviour pre #147835, but that is still
broken for the constructor names of class templates, since in that case
the injected class name type is used, but here the type printer is
configured to also print the implicit template arguments.

No release notes since this regression was never released.

Fixes #155537</pre>
</div>
</content>
</entry>
</feed>
