<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/lib/Target/DirectX/DXILPrepare.cpp, branch users/nico/python-2</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>[DirectX] Strip `dx.rootsignatures` metadata during `dxil-prepare` (#145746)</title>
<updated>2025-06-25T21:06:46+00:00</updated>
<author>
<name>Finn Plummer</name>
<email>finn.c.plum@gmail.com</email>
</author>
<published>2025-06-25T21:06:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a8ef75e758982d8e66790ffe26fcc6f1d9648e88'/>
<id>a8ef75e758982d8e66790ffe26fcc6f1d9648e88</id>
<content type='text'>
The `dx.rootsignatures` metadata is not recognized in DXIL, so failure
to remove this will cause validation errors.

This metadata is parsed (within `RootSignatureAnalysisWrapper`) into its
binary format. As such, once it has been used to construct the binary
form, it can be safely discarded without loss of information.

This pr ensures that the dxil prepare pass will depend and preserve on
the root signature analysis so that it runs before the metadata is
removed.

- Update `DXILPrepare.cpp` to preserve and depend on
`RootSignatureAnalysisWrapper`
- Update test to demonstrate order is correct
- Provide test-case to demonstrate the metadata is removed

Resolves https://github.com/llvm/llvm-project/issues/145437.

----------

Co-authored-by: Justin Bogner &lt;mail@justinbogner.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The `dx.rootsignatures` metadata is not recognized in DXIL, so failure
to remove this will cause validation errors.

This metadata is parsed (within `RootSignatureAnalysisWrapper`) into its
binary format. As such, once it has been used to construct the binary
form, it can be safely discarded without loss of information.

This pr ensures that the dxil prepare pass will depend and preserve on
the root signature analysis so that it runs before the metadata is
removed.

- Update `DXILPrepare.cpp` to preserve and depend on
`RootSignatureAnalysisWrapper`
- Update test to demonstrate order is correct
- Provide test-case to demonstrate the metadata is removed

Resolves https://github.com/llvm/llvm-project/issues/145437.

----------

Co-authored-by: Justin Bogner &lt;mail@justinbogner.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title> [Reland] Adjust bit cast instruction filter for DXIL Prepare pass (#143783)</title>
<updated>2025-06-17T18:46:12+00:00</updated>
<author>
<name>Joshua Batista</name>
<email>jbatista@microsoft.com</email>
</author>
<published>2025-06-17T18:46:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=b59d4cf05447fdaf3d3c859e10db0b3c892f6ec6'/>
<id>b59d4cf05447fdaf3d3c859e10db0b3c892f6ec6</id>
<content type='text'>
Relands https://github.com/llvm/llvm-project/pull/142678, with a new
change to remove an unnecessary gep argument, after a revert was needed
due to unforeseen bugs.
Fixes https://github.com/llvm/llvm-project/issues/139013</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Relands https://github.com/llvm/llvm-project/pull/142678, with a new
change to remove an unnecessary gep argument, after a revert was needed
due to unforeseen bugs.
Fixes https://github.com/llvm/llvm-project/issues/139013</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[DirectX] Array GEPs need two indices (#142853)" and "Adjust bit cast instruction filter for DXIL Prepare pass (#142678)" (#143043)</title>
<updated>2025-06-06T00:41:37+00:00</updated>
<author>
<name>Farzon Lotfi</name>
<email>farzonlotfi@microsoft.com</email>
</author>
<published>2025-06-06T00:41:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=76c4ba6a1de4643bbe7096c0c16aa40cd825bb4a'/>
<id>76c4ba6a1de4643bbe7096c0c16aa40cd825bb4a</id>
<content type='text'>
- This reverts commit 9ab4c16042a38d5b80084afff52699e246ca9ea8.
- This reverts commit 1d6e8ec17d547a5f8a0db700dc107a2cd7a321e1.

Noticed a really weird behavior where release and debug builds have
different codegen for loads with geps after this PR. This is going to
take a minute to debug and figure out why so revert seems to make the
most sense.

```diff
diff --git a/llvm/test/CodeGen/DirectX/flatten-array.ll b/llvm/test/CodeGen/DirectX/flatten-array.ll
index 47d7b50cf018..efa9efeff13a 100644
--- a/llvm/test/CodeGen/DirectX/flatten-array.ll
+++ b/llvm/test/CodeGen/DirectX/flatten-array.ll
@@ -123,7 +123,8 @@ define void @gep_4d_test ()  {
@b = internal global [2 x [3 x [4 x i32]]] zeroinitializer, align 16
define void @global_gep_load() {
-  ; CHECK: load i32, ptr getelementptr inbounds ([24 x i32], ptr @a.1dim, i32 0, i32 6), align 4
+  ; CHECK: %1 = getelementptr inbounds [24 x i32], ptr @a.1dim, i32 0, i32 6
+  ; CHECK-NEXT: %2 = load i32, ptr %1, align 4
   ; CHECK-NEXT:    ret void
   %1 = getelementptr inbounds [2 x [3 x [4 x i32]]], [2 x [3 x [4 x i32]]]* @a, i32 0, i32 0
   %2 = getelementptr inbounds [3 x [4 x i32]], [3 x [4 x i32]]* %1, i32 0, i32 1
@@ -176,7 +177,8 @@ define void @global_incomplete_gep_chain(i32 %row, i32 %col) {
}
define void @global_gep_store() {
-  ; CHECK: store i32 1, ptr getelementptr inbounds ([24 x i32], ptr @b.1dim, i32 0, i32 13), align 4
+  ; CHECK: %1 = getelementptr inbounds [24 x i32], ptr @b.1dim, i32 0, i32 13
+  ; CHECK-NEXT: store i32 1, ptr %1, align 4
   ; CHECK-NEXT:    ret void
```</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- This reverts commit 9ab4c16042a38d5b80084afff52699e246ca9ea8.
- This reverts commit 1d6e8ec17d547a5f8a0db700dc107a2cd7a321e1.

Noticed a really weird behavior where release and debug builds have
different codegen for loads with geps after this PR. This is going to
take a minute to debug and figure out why so revert seems to make the
most sense.

```diff
diff --git a/llvm/test/CodeGen/DirectX/flatten-array.ll b/llvm/test/CodeGen/DirectX/flatten-array.ll
index 47d7b50cf018..efa9efeff13a 100644
--- a/llvm/test/CodeGen/DirectX/flatten-array.ll
+++ b/llvm/test/CodeGen/DirectX/flatten-array.ll
@@ -123,7 +123,8 @@ define void @gep_4d_test ()  {
@b = internal global [2 x [3 x [4 x i32]]] zeroinitializer, align 16
define void @global_gep_load() {
-  ; CHECK: load i32, ptr getelementptr inbounds ([24 x i32], ptr @a.1dim, i32 0, i32 6), align 4
+  ; CHECK: %1 = getelementptr inbounds [24 x i32], ptr @a.1dim, i32 0, i32 6
+  ; CHECK-NEXT: %2 = load i32, ptr %1, align 4
   ; CHECK-NEXT:    ret void
   %1 = getelementptr inbounds [2 x [3 x [4 x i32]]], [2 x [3 x [4 x i32]]]* @a, i32 0, i32 0
   %2 = getelementptr inbounds [3 x [4 x i32]], [3 x [4 x i32]]* %1, i32 0, i32 1
@@ -176,7 +177,8 @@ define void @global_incomplete_gep_chain(i32 %row, i32 %col) {
}
define void @global_gep_store() {
-  ; CHECK: store i32 1, ptr getelementptr inbounds ([24 x i32], ptr @b.1dim, i32 0, i32 13), align 4
+  ; CHECK: %1 = getelementptr inbounds [24 x i32], ptr @b.1dim, i32 0, i32 13
+  ; CHECK-NEXT: store i32 1, ptr %1, align 4
   ; CHECK-NEXT:    ret void
```</pre>
</div>
</content>
</entry>
<entry>
<title>Adjust bit cast instruction filter for DXIL Prepare pass (#142678)</title>
<updated>2025-06-05T21:41:14+00:00</updated>
<author>
<name>Joshua Batista</name>
<email>jbatista@microsoft.com</email>
</author>
<published>2025-06-05T21:41:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=1d6e8ec17d547a5f8a0db700dc107a2cd7a321e1'/>
<id>1d6e8ec17d547a5f8a0db700dc107a2cd7a321e1</id>
<content type='text'>
This PR addresses a specific edge case when deciding whether or not to
produce a bitcast instruction.
Specifically, when the given instruction is a global array, the element
type of the array wasn't correctly compared to the return type. In this
specific case, if the types are equal, a bitcast shouldn't be created,
but it was.
This PR checks to see if the element type of the array is the same as
the return type, and if it is, it doesn't create a bitcast instruction.

Fixes https://github.com/llvm/llvm-project/issues/139013</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This PR addresses a specific edge case when deciding whether or not to
produce a bitcast instruction.
Specifically, when the given instruction is a global array, the element
type of the array wasn't correctly compared to the return type. In this
specific case, if the types are equal, a bitcast shouldn't be created,
but it was.
This PR checks to see if the element type of the array is the same as
the return type, and if it is, it doesn't create a bitcast instruction.

Fixes https://github.com/llvm/llvm-project/issues/139013</pre>
</div>
</content>
</entry>
<entry>
<title>[HLSL] Move FNeg legalization to the DXILLegalization pass (#140942)</title>
<updated>2025-05-22T16:43:00+00:00</updated>
<author>
<name>Sumit Agarwal</name>
<email>sumitagarwal@microsoft.com</email>
</author>
<published>2025-05-22T16:43:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=b9361126488ff6749e23a997640f839dd20ac331'/>
<id>b9361126488ff6749e23a997640f839dd20ac331</id>
<content type='text'>
Fixes #137685</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes #137685</pre>
</div>
</content>
</entry>
<entry>
<title>[DXIL] Remove incompatible metadata types when preparing DXIL. (#136386)</title>
<updated>2025-04-28T19:43:38+00:00</updated>
<author>
<name>Joshua Batista</name>
<email>jbatista@microsoft.com</email>
</author>
<published>2025-04-28T19:43:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c8b3d79961834e62e15e8350cb35a5bd7fafae50'/>
<id>c8b3d79961834e62e15e8350cb35a5bd7fafae50</id>
<content type='text'>
This PR introduces a Metadata Node Kind allowlist. The purpose is to
prevent newer Metadata Node Kinds to be used and inserted into the
outputted DXIL module. Only the metadata kinds that are accepted in the
DXIL Validator are on the allowlist. The Github DXC validator doesn't
support these newer Metadata Node Kinds, so we need to filter them out.

We introduce this restrictive allowlist into LLVM and strip all metadata
that isn't found in the list.

The accompanying test would add the `llvm.loop.mustprogress` metadata
node kind, but thanks to the allowlist, filters it out, and so the
whitelist is proven to work.
The test also has two separate metadata kinds that are on the allowlist,
and remain after the DXIL Prepare pass.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This PR introduces a Metadata Node Kind allowlist. The purpose is to
prevent newer Metadata Node Kinds to be used and inserted into the
outputted DXIL module. Only the metadata kinds that are accepted in the
DXIL Validator are on the allowlist. The Github DXC validator doesn't
support these newer Metadata Node Kinds, so we need to filter them out.

We introduce this restrictive allowlist into LLVM and strip all metadata
that isn't found in the list.

The accompanying test would add the `llvm.loop.mustprogress` metadata
node kind, but thanks to the allowlist, filters it out, and so the
whitelist is proven to work.
The test also has two separate metadata kinds that are on the allowlist,
and remain after the DXIL Prepare pass.</pre>
</div>
</content>
</entry>
<entry>
<title>[NFC][HLSL] Rename ResourceBinding Types (#134165)</title>
<updated>2025-04-04T22:51:35+00:00</updated>
<author>
<name>Ashley Coleman</name>
<email>ascoleman@microsoft.com</email>
</author>
<published>2025-04-04T22:51:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=e3369a8dc9130ef261a092d866e8ba4f8242aa26'/>
<id>e3369a8dc9130ef261a092d866e8ba4f8242aa26</id>
<content type='text'>
Non-functional change as first step in
https://github.com/llvm/wg-hlsl/pull/207

Removes `Binding` from "Resource Instance" types</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Non-functional change as first step in
https://github.com/llvm/wg-hlsl/pull/207

Removes `Binding` from "Resource Instance" types</pre>
</div>
</content>
</entry>
<entry>
<title>[DirectX] Remove DXILResourceMDAnalysis (#130323)</title>
<updated>2025-03-12T15:45:10+00:00</updated>
<author>
<name>Helena Kotas</name>
<email>hekotas@microsoft.com</email>
</author>
<published>2025-03-12T15:45:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=1db978cd781314a15277ea23a11ebd58604685d7'/>
<id>1db978cd781314a15277ea23a11ebd58604685d7</id>
<content type='text'>
Removing `DXILResourceMDAnalysis` that gathers information about
resources for the `DXILTranslateMetadata` pass. It collects the info
based on obsolete resource metadata annotations that are going to be
removed soon.

Part 1/2 of #114126</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Removing `DXILResourceMDAnalysis` that gathers information about
resources for the `DXILTranslateMetadata` pass. It collects the info
based on obsolete resource metadata annotations that are going to be
removed soon.

Part 1/2 of #114126</pre>
</div>
</content>
</entry>
<entry>
<title>[IR] Convert from nocapture to captures(none) (#123181)</title>
<updated>2025-01-29T15:56:47+00:00</updated>
<author>
<name>Nikita Popov</name>
<email>npopov@redhat.com</email>
</author>
<published>2025-01-29T15:56:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=29441e4f5fa5f5c7709f7cf180815ba97f611297'/>
<id>29441e4f5fa5f5c7709f7cf180815ba97f611297</id>
<content type='text'>
This PR removes the old `nocapture` attribute, replacing it with the new
`captures` attribute introduced in #116990. This change is
intended to be essentially NFC, replacing existing uses of `nocapture`
with `captures(none)` without adding any new analysis capabilities.
Making use of non-`none` values is left for a followup.

Some notes:
* `nocapture` will be upgraded to `captures(none)` by the bitcode
   reader.
* `nocapture` will also be upgraded by the textual IR reader. This is to
   make it easier to use old IR files and somewhat reduce the test churn in
   this PR.
* Helper APIs like `doesNotCapture()` will check for `captures(none)`.
* MLIR import will convert `captures(none)` into an `llvm.nocapture`
   attribute. The representation in the LLVM IR dialect should be updated
   separately.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This PR removes the old `nocapture` attribute, replacing it with the new
`captures` attribute introduced in #116990. This change is
intended to be essentially NFC, replacing existing uses of `nocapture`
with `captures(none)` without adding any new analysis capabilities.
Making use of non-`none` values is left for a followup.

Some notes:
* `nocapture` will be upgraded to `captures(none)` by the bitcode
   reader.
* `nocapture` will also be upgraded by the textual IR reader. This is to
   make it easier to use old IR files and somewhat reduce the test churn in
   this PR.
* Helper APIs like `doesNotCapture()` will check for `captures(none)`.
* MLIR import will convert `captures(none)` into an `llvm.nocapture`
   attribute. The representation in the LLVM IR dialect should be updated
   separately.</pre>
</div>
</content>
</entry>
<entry>
<title>[DirectX] Split resource info into type and binding info. NFC (#119773)</title>
<updated>2024-12-18T16:02:28+00:00</updated>
<author>
<name>Justin Bogner</name>
<email>mail@justinbogner.com</email>
</author>
<published>2024-12-18T16:02:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=3eca15cbb9888a992749ddd24f0fb666dad733bf'/>
<id>3eca15cbb9888a992749ddd24f0fb666dad733bf</id>
<content type='text'>
This splits the DXILResourceAnalysis pass into TypeAnalysis and
BindingAnalysis passes. The type analysis pass is made immutable and
populated lazily so that it can be used earlier in the pipeline without
needing to carefully maintain the invariants of the binding analysis.

Fixes #118400</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This splits the DXILResourceAnalysis pass into TypeAnalysis and
BindingAnalysis passes. The type analysis pass is made immutable and
populated lazily so that it can be used earlier in the pipeline without
needing to carefully maintain the invariants of the binding analysis.

Fixes #118400</pre>
</div>
</content>
</entry>
</feed>
