<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/lib/Target/DirectX/DXILDataScalarization.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] Allow vector Allocas to be transformed into arrays (#145972)</title>
<updated>2025-06-27T17:12:47+00:00</updated>
<author>
<name>Farzon Lotfi</name>
<email>farzonlotfi@microsoft.com</email>
</author>
<published>2025-06-27T17:12:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=778b6a21ec27ed05c794b9fca3f27c1064280fb2'/>
<id>778b6a21ec27ed05c794b9fca3f27c1064280fb2</id>
<content type='text'>
fixes #145782

This change modifies `isArrayOfVectors` into `isVectorOrArrayOfVectors`.
The previous implementation did not support vector to array
transformations. Further it was too simplistic and didn't assume allocas
would create multidimensional arrays.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
fixes #145782

This change modifies `isArrayOfVectors` into `isVectorOrArrayOfVectors`.
The previous implementation did not support vector to array
transformations. Further it was too simplistic and didn't assume allocas
would create multidimensional arrays.</pre>
</div>
</content>
</entry>
<entry>
<title>[DirectX] Limit GEP transformations to Arrays (#145758)</title>
<updated>2025-06-25T21:17:52+00:00</updated>
<author>
<name>Farzon Lotfi</name>
<email>farzonlotfi@microsoft.com</email>
</author>
<published>2025-06-25T21:17:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=38aec4f1f422daf522e50204b794e9c071e5c61f'/>
<id>38aec4f1f422daf522e50204b794e9c071e5c61f</id>
<content type='text'>
fixes #145408

Before we see the GEP we already have transformed Allocas that get
passed the `isArrayOfVectors`.
The bug is because we are trying to transform a gep for struct of arrays
when we should only be transforming arrays.

The problem with our `visitGetElementPtrInst` is that it was doing
transformations for all allocas when it should be limiting it to the
alloca of array cases. Technically we would have liked to make sure it
was an array of vectors cases but by the time we see the GEP the type
has been changed by replace all uses. There should not be a problem with
looking at all Arrays since DXILDataScalarization does not change any
indicies.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
fixes #145408

Before we see the GEP we already have transformed Allocas that get
passed the `isArrayOfVectors`.
The bug is because we are trying to transform a gep for struct of arrays
when we should only be transforming arrays.

The problem with our `visitGetElementPtrInst` is that it was doing
transformations for all allocas when it should be limiting it to the
alloca of array cases. Technically we would have liked to make sure it
was an array of vectors cases but by the time we see the GEP the type
has been changed by replace all uses. There should not be a problem with
looking at all Arrays since DXILDataScalarization does not change any
indicies.</pre>
</div>
</content>
</entry>
<entry>
<title>[DirectX] Don't limit visitGetElementPtrInst to global ptrs (#144959)</title>
<updated>2025-06-20T19:23:20+00:00</updated>
<author>
<name>Farzon Lotfi</name>
<email>farzonlotfi@microsoft.com</email>
</author>
<published>2025-06-20T19:23:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=2a4207e7322c90176814b17870051f9692f9994f'/>
<id>2a4207e7322c90176814b17870051f9692f9994f</id>
<content type='text'>
fixes #144608
- there is a getPointerOperandIndex function so we don't need to iterate
the operands trying to find the pointer. This resulted in a small
cleanup to visitStoreInst and visitLoadInst.

- The meat of this change was in visitGetElementPtrInst to account for
allocas and not bail when we don't find a global.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
fixes #144608
- there is a getPointerOperandIndex function so we don't need to iterate
the operands trying to find the pointer. This resulted in a small
cleanup to visitStoreInst and visitLoadInst.

- The meat of this change was in visitGetElementPtrInst to account for
allocas and not bail when we don't find a global.</pre>
</div>
</content>
</entry>
<entry>
<title>[DirectX] Scalarize `extractelement` and `insertelement` with dynamic indices (#141676)</title>
<updated>2025-06-20T18:20:30+00:00</updated>
<author>
<name>Deric C.</name>
<email>cheung.deric@gmail.com</email>
</author>
<published>2025-06-20T18:20:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=3f42c6bddd2495710331c82ce117ee7d5a58856d'/>
<id>3f42c6bddd2495710331c82ce117ee7d5a58856d</id>
<content type='text'>
Fixes #141136

- Implement `visitExtractElementInst` and `visitInsertElementInst` in
`DXILDataScalarizerVisitor` to scalarize `extractelement` and
`insertelement` instructions whose index operand is not a `ConstantInt`
by converting the vector to an array and then loading from the array
- Rename the `replaceVectorWithArray` helper function to
`equivalentArrayTypeFromVector`, relocate the function toward the top of
the file, and remove the unused `Ctx` parameter</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes #141136

- Implement `visitExtractElementInst` and `visitInsertElementInst` in
`DXILDataScalarizerVisitor` to scalarize `extractelement` and
`insertelement` instructions whose index operand is not a `ConstantInt`
by converting the vector to an array and then loading from the array
- Rename the `replaceVectorWithArray` helper function to
`equivalentArrayTypeFromVector`, relocate the function toward the top of
the file, and remove the unused `Ctx` parameter</pre>
</div>
</content>
</entry>
<entry>
<title>[DirectX] Scalarize Allocas as part of data scalarization (#140165)</title>
<updated>2025-05-27T18:23:29+00:00</updated>
<author>
<name>Farzon Lotfi</name>
<email>farzonlotfi@microsoft.com</email>
</author>
<published>2025-05-27T18:23:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=909212feecc197e469384924554087125ef1b7ea'/>
<id>909212feecc197e469384924554087125ef1b7ea</id>
<content type='text'>
- DXILDataScalarization should not just be limited to global data
- Add a scalarization for alloca
- Add ReversePostOrderTraversal of functions and iterate over basic
blocks and run DataScalarizerVisitor.
- fixes #140143</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- DXILDataScalarization should not just be limited to global data
- Add a scalarization for alloca
- Add ReversePostOrderTraversal of functions and iterate over basic
blocks and run DataScalarizerVisitor.
- fixes #140143</pre>
</div>
</content>
</entry>
<entry>
<title>[Target] Use llvm::append_range (NFC) (#133606)</title>
<updated>2025-03-30T01:47:47+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2025-03-30T01:47:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=ad1ba15ea894ac47b0f2447db191a14ebe1b301d'/>
<id>ad1ba15ea894ac47b0f2447db191a14ebe1b301d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[NFC][DirectX] Change deprecated insertBefore(Instruction*) API (#125308)</title>
<updated>2025-01-31T22:45:16+00:00</updated>
<author>
<name>S. Bharadwaj Yadavalli</name>
<email>Bharadwaj.Yadavalli@microsoft.com</email>
</author>
<published>2025-01-31T22:45:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=41745a200557c8a8b556bfc91fb2908a141b20e5'/>
<id>41745a200557c8a8b556bfc91fb2908a141b20e5</id>
<content type='text'>
This fixes build errors due to deprecation of this API in commit
79499f010d2bfe809187a9a5f042d4e4ee1f1bcc

All tests in llvm/test/CodeGen/DirectX - including those added in commit
5ac624c8234fe0a62cbf0447dbf7035ea29d062e that added the original code
verified to pass.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This fixes build errors due to deprecation of this API in commit
79499f010d2bfe809187a9a5f042d4e4ee1f1bcc

All tests in llvm/test/CodeGen/DirectX - including those added in commit
5ac624c8234fe0a62cbf0447dbf7035ea29d062e that added the original code
verified to pass.</pre>
</div>
</content>
</entry>
<entry>
<title>[DirectX] Bug fix for Data Scalarization crash (#118426)</title>
<updated>2024-12-18T21:33:49+00:00</updated>
<author>
<name>Farzon Lotfi</name>
<email>farzonlotfi@microsoft.com</email>
</author>
<published>2024-12-18T21:33:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=6457aee5b7da6bb6d7f556d14f42a6763b42e060'/>
<id>6457aee5b7da6bb6d7f556d14f42a6763b42e060</id>
<content type='text'>
Two bugs here. First calling `Inst-&gt;getFunction()` has undefined
behavior if the instruction is not tracked to a function. I suspect the
`replaceAllUsesWith` was leaving the GEPs in a weird ghost parent
situation. I switched up the visitor to be able to `eraseFromParent` as
part of visiting and then everything started working.

The second bug was in `DXILFlattenArrays.cpp`. I was unaware that you
can have multidimensional arrays of `zeroinitializer`, and `undef` so
fixed up the initializer to handle these two cases.

fixes #117273</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Two bugs here. First calling `Inst-&gt;getFunction()` has undefined
behavior if the instruction is not tracked to a function. I suspect the
`replaceAllUsesWith` was leaving the GEPs in a weird ghost parent
situation. I switched up the visitor to be able to `eraseFromParent` as
part of visiting and then everything started working.

The second bug was in `DXILFlattenArrays.cpp`. I was unaware that you
can have multidimensional arrays of `zeroinitializer`, and `undef` so
fixed up the initializer to handle these two cases.

fixes #117273</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>
<entry>
<title>[DirectX] Data Scalarization of Vectors in Global Scope (#110029)</title>
<updated>2024-09-26T21:16:29+00:00</updated>
<author>
<name>Farzon Lotfi</name>
<email>1802579+farzonl@users.noreply.github.com</email>
</author>
<published>2024-09-26T21:16:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=324bdd662dedfd03b884e082f577a8ad6dc1f8a6'/>
<id>324bdd662dedfd03b884e082f577a8ad6dc1f8a6</id>
<content type='text'>
This change adds a pass to scalarize vectors in global scope into
arrays.

There are three distinct parts
1. find the globals that need to be updated and define what the new type
should be
2. initialize that new type and copy over all the right attributes over
from the old type.
3. Use the instruction visitor pattern to update the loads, stores, and
geps for the layout of the new data structure.

resolves https://github.com/llvm/llvm-project/issues/107920</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This change adds a pass to scalarize vectors in global scope into
arrays.

There are three distinct parts
1. find the globals that need to be updated and define what the new type
should be
2. initialize that new type and copy over all the right attributes over
from the old type.
3. Use the instruction visitor pattern to update the loads, stores, and
geps for the layout of the new data structure.

resolves https://github.com/llvm/llvm-project/issues/107920</pre>
</div>
</content>
</entry>
</feed>
