<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/test/CodeGen/SPIRV/structurizer, 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>[SPIRV] Change how to detect OpenCL/Vulkan Env and update tests accordingly. (#129689)</title>
<updated>2025-06-03T13:50:23+00:00</updated>
<author>
<name>Marcos Maronas</name>
<email>marcos.maronas@intel.com</email>
</author>
<published>2025-06-03T13:50:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=b1703ad38d5bbdb5ede49fb06dc7d63582359b30'/>
<id>b1703ad38d5bbdb5ede49fb06dc7d63582359b30</id>
<content type='text'>
A new test added for spirv-friendly builtins for
SPV_KHR_bit_instructions unveiled that current mechanism to detect
whether SPIRV Backend is in OpenCL environment or Vulkan environment was
not good enough. This PR updates how to detect the environment and all
the tests accordingly.

*UPDATE*: the new approach is having a new member in `SPIRVSubtarget` to
represent the environment. It can be either OpenCL, Kernel or Unknown.
If the triple is explicit, we can directly set it at the creation of the
`SPIRVSubtarget`, otherwise we just leave it unknown until we find other
information that can help us set the environment. For now, the only
other information we use to set the environment is `hlsl.shader`
attribute at `SPIRV::ExecutionModel::ExecutionModel
getExecutionModel(const SPIRVSubtarget &amp;STI, const Function &amp;F)`. Going
forward we should consider also specific instructions that are
Kernel-exclusive or Shader-exclusive.

---------

Co-authored-by: marcos.maronas &lt;mmaronas@smtp.igk.intel.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A new test added for spirv-friendly builtins for
SPV_KHR_bit_instructions unveiled that current mechanism to detect
whether SPIRV Backend is in OpenCL environment or Vulkan environment was
not good enough. This PR updates how to detect the environment and all
the tests accordingly.

*UPDATE*: the new approach is having a new member in `SPIRVSubtarget` to
represent the environment. It can be either OpenCL, Kernel or Unknown.
If the triple is explicit, we can directly set it at the creation of the
`SPIRVSubtarget`, otherwise we just leave it unknown until we find other
information that can help us set the environment. For now, the only
other information we use to set the environment is `hlsl.shader`
attribute at `SPIRV::ExecutionModel::ExecutionModel
getExecutionModel(const SPIRVSubtarget &amp;STI, const Function &amp;F)`. Going
forward we should consider also specific instructions that are
Kernel-exclusive or Shader-exclusive.

---------

Co-authored-by: marcos.maronas &lt;mmaronas@smtp.igk.intel.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[SPIR-V] Add llvm.loop.unroll metadata lowering (#132062)</title>
<updated>2025-03-28T12:27:08+00:00</updated>
<author>
<name>Dmitry Sidorov</name>
<email>dmitry.sidorov@intel.com</email>
</author>
<published>2025-03-28T12:27:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=7f103ad537a64cd47dc49c661ad0245ea3ae2fdc'/>
<id>7f103ad537a64cd47dc49c661ad0245ea3ae2fdc</id>
<content type='text'>
.enable lowers to Unroll LoopControl
.disable lowers to DontUnroll LoopControl
.count lowers to PartialCount LoopControl
.full lowers to Unroll LoopControl

TODO in future patches: enable structurizer for non-vulkan targets.

---------

Signed-off-by: Sidorov, Dmitry &lt;dmitry.sidorov@intel.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
.enable lowers to Unroll LoopControl
.disable lowers to DontUnroll LoopControl
.count lowers to PartialCount LoopControl
.full lowers to Unroll LoopControl

TODO in future patches: enable structurizer for non-vulkan targets.

---------

Signed-off-by: Sidorov, Dmitry &lt;dmitry.sidorov@intel.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[SPIR-V] Mark XFAIL the test case that fails with LLVM_ENABLE_EXPENSIVE_CHECKS enabled (#133142)</title>
<updated>2025-03-28T11:55:31+00:00</updated>
<author>
<name>Vyacheslav Levytskyy</name>
<email>vyacheslav.levytskyy@intel.com</email>
</author>
<published>2025-03-28T11:55:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=b009c5af71a8676f1e6b4332f867957454635b2f'/>
<id>b009c5af71a8676f1e6b4332f867957454635b2f</id>
<content type='text'>
After https://github.com/llvm/llvm-project/pull/130605
structurizer/cf.switch.ifstmt.simple2.ll test case starts failing with
the "PHI operand is not live-out from predecessor" diagnostic message.
This test case didn't include usual "-verify-machineinstrs" argument and
the fail was missed before
https://github.com/llvm/llvm-project/pull/130605 merging.

The problem looks not blocking, because the test case successfully
passes its CHECK's. This PR is to fix the build process by mark the test
case as XFAIL when LLVM_ENABLE_EXPENSIVE_CHECKS is enabled.

Investigation of the Machine Verifier complaint is to do. The issue is
created: https://github.com/llvm/llvm-project/issues/133141</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
After https://github.com/llvm/llvm-project/pull/130605
structurizer/cf.switch.ifstmt.simple2.ll test case starts failing with
the "PHI operand is not live-out from predecessor" diagnostic message.
This test case didn't include usual "-verify-machineinstrs" argument and
the fail was missed before
https://github.com/llvm/llvm-project/pull/130605 merging.

The problem looks not blocking, because the test case successfully
passes its CHECK's. This PR is to fix the build process by mark the test
case as XFAIL when LLVM_ENABLE_EXPENSIVE_CHECKS is enabled.

Investigation of the Machine Verifier complaint is to do. The issue is
created: https://github.com/llvm/llvm-project/issues/133141</pre>
</div>
</content>
</entry>
<entry>
<title>[HLSL] Add support to branch/flatten attributes to switch (#131739)</title>
<updated>2025-03-24T23:17:19+00:00</updated>
<author>
<name>joaosaffran</name>
<email>126493771+joaosaffran@users.noreply.github.com</email>
</author>
<published>2025-03-24T23:17:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=567b0f89239b0e3f0e96419038863f2386b635e3'/>
<id>567b0f89239b0e3f0e96419038863f2386b635e3</id>
<content type='text'>
closes: [#125754](https://github.com/llvm/llvm-project/issues/125754)

---------

Co-authored-by: joaosaffran &lt;joao.saffran@microsoft.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
closes: [#125754](https://github.com/llvm/llvm-project/issues/125754)

---------

Co-authored-by: joaosaffran &lt;joao.saffran@microsoft.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[HLSL] Adding Flatten and Branch if attributes with test fixes (#122157)</title>
<updated>2025-01-13T18:31:25+00:00</updated>
<author>
<name>joaosaffran</name>
<email>126493771+joaosaffran@users.noreply.github.com</email>
</author>
<published>2025-01-13T18:31:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=380bb51b70b6d9f3da07a87f56fc3fe44bc78691'/>
<id>380bb51b70b6d9f3da07a87f56fc3fe44bc78691</id>
<content type='text'>
- Adding the changes from PRs: 
  - #116331 
  - #121852 
- Fixes test `tools/dxil-dis/debug-info.ll`
- Address some missed comments in the previous PR

---------

Co-authored-by: joaosaffran &lt;joao.saffran@microsoft.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- Adding the changes from PRs: 
  - #116331 
  - #121852 
- Fixes test `tools/dxil-dis/debug-info.ll`
- Address some missed comments in the previous PR

---------

Co-authored-by: joaosaffran &lt;joao.saffran@microsoft.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>Revert #116331 &amp; #121852 (#122105)</title>
<updated>2025-01-08T14:55:02+00:00</updated>
<author>
<name>Chris B</name>
<email>chris.bieneman@me.com</email>
</author>
<published>2025-01-08T14:55:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=b66f6b25cb5107d4c8f78d13b08d2bdba39ad919'/>
<id>b66f6b25cb5107d4c8f78d13b08d2bdba39ad919</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[HLSL] Adding Flatten and Branch if attributes (#116331)</title>
<updated>2025-01-06T18:27:02+00:00</updated>
<author>
<name>joaosaffran</name>
<email>126493771+joaosaffran@users.noreply.github.com</email>
</author>
<published>2025-01-06T18:27:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=0d5c07285f79a2135730c919c7e7b8e2bd9118e7'/>
<id>0d5c07285f79a2135730c919c7e7b8e2bd9118e7</id>
<content type='text'>
- adding Flatten and Branch to if stmt.
- adding dxil control flow hint metadata generation
- modifing spirv OpSelectMerge to account for the specific attributes.

Closes #70112

---------

Co-authored-by: Joao Saffran &lt;jderezende@microsoft.com&gt;
Co-authored-by: joaosaffran &lt;joao.saffran@microsoft.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- adding Flatten and Branch to if stmt.
- adding dxil control flow hint metadata generation
- modifing spirv OpSelectMerge to account for the specific attributes.

Closes #70112

---------

Co-authored-by: Joao Saffran &lt;jderezende@microsoft.com&gt;
Co-authored-by: joaosaffran &lt;joao.saffran@microsoft.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[SPIR-V] Add partial order tests, assert reducible (#117887)</title>
<updated>2024-11-28T15:33:01+00:00</updated>
<author>
<name>Nathan Gauër</name>
<email>brioche@google.com</email>
</author>
<published>2024-11-28T15:33:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=45b567be8d0d430c786c41f826d192fadf863bb8'/>
<id>45b567be8d0d430c786c41f826d192fadf863bb8</id>
<content type='text'>
Add testing for the visitor and added a note explaining irreducible CFG
are not supported.
Related to #116692

---------

Signed-off-by: Nathan Gauër &lt;brioche@google.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add testing for the visitor and added a note explaining irreducible CFG
are not supported.
Related to #116692

---------

Signed-off-by: Nathan Gauër &lt;brioche@google.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[SPIR-V] Fix block sorting with irreducible CFG (#116996)</title>
<updated>2024-11-28T12:42:57+00:00</updated>
<author>
<name>Nathan Gauër</name>
<email>brioche@google.com</email>
</author>
<published>2024-11-28T12:42:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=53326ee0cf45fce3f80e2e98638dd27edb20c516'/>
<id>53326ee0cf45fce3f80e2e98638dd27edb20c516</id>
<content type='text'>
Block sorting was assuming reducible CFG. Meaning we always had a best
node to continue with. Irreducible CFG makes breaks this assumption, so
the algorithm looped indefinitely because no node was a valid candidate.

Fixes #116692

---------

Signed-off-by: Nathan Gauër &lt;brioche@google.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Block sorting was assuming reducible CFG. Meaning we always had a best
node to continue with. Irreducible CFG makes breaks this assumption, so
the algorithm looped indefinitely because no node was a valid candidate.

Fixes #116692

---------

Signed-off-by: Nathan Gauër &lt;brioche@google.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[SPIR-V] Fix BB ordering &amp; register lifetime (#111026)</title>
<updated>2024-10-30T13:57:32+00:00</updated>
<author>
<name>Nathan Gauër</name>
<email>brioche@google.com</email>
</author>
<published>2024-10-30T13:57:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=cba70550ccf55c6ad3daa621bb8caf3c4ca6cbd7'/>
<id>cba70550ccf55c6ad3daa621bb8caf3c4ca6cbd7</id>
<content type='text'>
The "topological" sorting was behaving incorrectly in some cases: 
the exit of a loop could have a lower rank than a node in the loop.
This causes issues when structurizing some patterns, and also codegen
issues as we could generate BBs in the incorrect order in regard to the
SPIR-V spec.

Fixing this ordering alone broke other parts of the structurizer, which
by luck worked. Had to fix those.

Added more test cases, especially to test basic patterns.

I also needed to tweak/disable some tests for 2 reasons:
 - SPIR-V now required reg2mem/mem2reg to run. Meaning dead stores
   are optimized away. Some tests require tweaks to avoid having the
   whole function removed.
 - Mem2Reg will generate variable &amp; load/stores. This generates
   G_BITCAST in several cases. And there is currently something wrong
   we do with G_BITCAST which causes MIR verifier to complain.
   Until this is resolved, I disabled -verify-machineinstrs flag on
   those tests.

---------

Signed-off-by: Nathan Gauër &lt;brioche@google.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The "topological" sorting was behaving incorrectly in some cases: 
the exit of a loop could have a lower rank than a node in the loop.
This causes issues when structurizing some patterns, and also codegen
issues as we could generate BBs in the incorrect order in regard to the
SPIR-V spec.

Fixing this ordering alone broke other parts of the structurizer, which
by luck worked. Had to fix those.

Added more test cases, especially to test basic patterns.

I also needed to tweak/disable some tests for 2 reasons:
 - SPIR-V now required reg2mem/mem2reg to run. Meaning dead stores
   are optimized away. Some tests require tweaks to avoid having the
   whole function removed.
 - Mem2Reg will generate variable &amp; load/stores. This generates
   G_BITCAST in several cases. And there is currently something wrong
   we do with G_BITCAST which causes MIR verifier to complain.
   Until this is resolved, I disabled -verify-machineinstrs flag on
   those tests.

---------

Signed-off-by: Nathan Gauër &lt;brioche@google.com&gt;</pre>
</div>
</content>
</entry>
</feed>
