<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/lib/Target/AMDGPU/SIPeepholeSDWA.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>[AMDGPU][MC] Allow opsel for v_max_i16 etc in GFX10 (#143982)</title>
<updated>2025-06-26T21:08:13+00:00</updated>
<author>
<name>Jun Wang</name>
<email>jwang86@yahoo.com</email>
</author>
<published>2025-06-26T21:08:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=063cee7bdeefa8696845ec1006d3baaf1e6d251a'/>
<id>063cee7bdeefa8696845ec1006d3baaf1e6d251a</id>
<content type='text'>
In GFX10, a number of VOP3 instructions should allow opsel, including
V_MAX_I16, V_MAX_U16, V_MIN_I16, V_MIN_U16, V_MUL_LO_U16, V_LSHLREV_B16,
V_LSHRREV_B16, and V_ASHRREV_I16.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In GFX10, a number of VOP3 instructions should allow opsel, including
V_MAX_I16, V_MAX_U16, V_MIN_I16, V_MIN_U16, V_MUL_LO_U16, V_LSHLREV_B16,
V_LSHRREV_B16, and V_ASHRREV_I16.</pre>
</div>
</content>
</entry>
<entry>
<title>[AMDGPU] si-peephole-sdwa: Remove dead code from createSDWAversion (#141462)</title>
<updated>2025-05-26T13:28:03+00:00</updated>
<author>
<name>Frederik Harwath</name>
<email>frederik.harwath@amd.com</email>
</author>
<published>2025-05-26T13:28:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=8a198f89bfa0fb8225a3ffc90df8c7b9b722aeff'/>
<id>8a198f89bfa0fb8225a3ffc90df8c7b9b722aeff</id>
<content type='text'>
In an earlier state of this code, it was possible for an existing SDWA
MI to reach the code in the "createSDWAversion" function. This is no
longer possible; see assert at the top of the function.

Remove code that tries to handle operands on pre-existing SDWA
instructions from the function.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In an earlier state of this code, it was possible for an existing SDWA
MI to reach the code in the "createSDWAversion" function. This is no
longer possible; see assert at the top of the function.

Remove code that tries to handle operands on pre-existing SDWA
instructions from the function.</pre>
</div>
</content>
</entry>
<entry>
<title>[AMDGPU] si-peephole-sdwa: Disable V_CNDMASK_B32 conversion with sext (#140760)</title>
<updated>2025-05-26T07:33:09+00:00</updated>
<author>
<name>Frederik Harwath</name>
<email>frederik.harwath@amd.com</email>
</author>
<published>2025-05-26T07:33:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=d45031ce5281b9fae54f2fdf5edff831e1308976'/>
<id>d45031ce5281b9fae54f2fdf5edff831e1308976</id>
<content type='text'>
The sext modifier on an operand of V_CNDMASK_B32_sdwa gets erroneously
turned into a neg modifier in the assembly output.

As a workaround, to avoid miscompilation, this patch disables the
conversion of V_CNDMASK_B32 to the SDWA form if any operand uses an sext
modifier.

Fixes #138766.

---------

Co-authored-by: Matt Arsenault &lt;arsenm2@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The sext modifier on an operand of V_CNDMASK_B32_sdwa gets erroneously
turned into a neg modifier in the assembly output.

As a workaround, to avoid miscompilation, this patch disables the
conversion of V_CNDMASK_B32 to the SDWA form if any operand uses an sext
modifier.

Fixes #138766.

---------

Co-authored-by: Matt Arsenault &lt;arsenm2@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[AMDGPU] si-peephole-sdwa: Fix cndmask vcc use for wave32 (#139541)</title>
<updated>2025-05-14T05:37:01+00:00</updated>
<author>
<name>Frederik Harwath</name>
<email>frederik.harwath@amd.com</email>
</author>
<published>2025-05-14T05:37:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=1377535d993ca9457978d0065dde59ccf1aca187'/>
<id>1377535d993ca9457978d0065dde59ccf1aca187</id>
<content type='text'>
Before V_CNDMASK_B32_e64 gets converted to SDWA form, a conversion to
V_CNDMASK_B32_e32 occurs.
The vcc use of this instruction must be fixed into a vcc_lo use for wave32.
This fix only happens after the final conversion to the SDWA form. This led
to a compiler error in situations where the conversion to SDWA aborts.

Make sure that the vcc-fix gets applied even if the SDWA conversion is
not completed.

---------

Co-authored-by: Matt Arsenault &lt;arsenm2@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Before V_CNDMASK_B32_e64 gets converted to SDWA form, a conversion to
V_CNDMASK_B32_e32 occurs.
The vcc use of this instruction must be fixed into a vcc_lo use for wave32.
This fix only happens after the final conversion to the SDWA form. This led
to a compiler error in situations where the conversion to SDWA aborts.

Make sure that the vcc-fix gets applied even if the SDWA conversion is
not completed.

---------

Co-authored-by: Matt Arsenault &lt;arsenm2@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[AMDGPU] Fix a warning</title>
<updated>2025-05-05T17:07:22+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2025-05-05T17:07:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=e1cff21f65fc876f7a9d0531a4b4d2aa3f0b4f21'/>
<id>e1cff21f65fc876f7a9d0531a4b4d2aa3f0b4f21</id>
<content type='text'>
This patch fixes:

  llvm/lib/Target/AMDGPU/SIPeepholeSDWA.cpp:1102:8: error: unused
  variable 'Converted' [-Werror,-Wunused-variable]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch fixes:

  llvm/lib/Target/AMDGPU/SIPeepholeSDWA.cpp:1102:8: error: unused
  variable 'Converted' [-Werror,-Wunused-variable]
</pre>
</div>
</content>
</entry>
<entry>
<title>[AMDGPU] SIPeepholeSDWA: Handle V_CNDMASK_B32_e64 (#137930)</title>
<updated>2025-05-05T16:14:14+00:00</updated>
<author>
<name>Frederik Harwath</name>
<email>frederik.harwath@amd.com</email>
</author>
<published>2025-05-05T16:14:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=721cba476d68bae13e9c0a0060fd37c386050e74'/>
<id>721cba476d68bae13e9c0a0060fd37c386050e74</id>
<content type='text'>
The VOP3 form of the V_CNDMASK_B32 instruction takes a carry-in
operand. The conversion to SDWA implies a conversion to VOP2 form
which reads from VCC instead.

Convert V_CNDMASK_B32_e64 instructions that might be converted to SDWA
to V_CNDMASK_B32_e32 first and introduce a copy of the carry-in operand
to VCC.

Closes #133431.

---------

Co-authored-by: Matt Arsenault &lt;arsenm2@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The VOP3 form of the V_CNDMASK_B32 instruction takes a carry-in
operand. The conversion to SDWA implies a conversion to VOP2 form
which reads from VCC instead.

Convert V_CNDMASK_B32_e64 instructions that might be converted to SDWA
to V_CNDMASK_B32_e32 first and introduce a copy of the carry-in operand
to VCC.

Closes #133431.

---------

Co-authored-by: Matt Arsenault &lt;arsenm2@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[AMDGPU] Account for existing SDWA selections  (#123221)</title>
<updated>2025-03-03T16:07:28+00:00</updated>
<author>
<name>Frederik Harwath</name>
<email>frederik.harwath@amd.com</email>
</author>
<published>2025-03-03T16:07:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=ba9bd22e1b535a1669e3918fa77f6edaf6851d9a'/>
<id>ba9bd22e1b535a1669e3918fa77f6edaf6851d9a</id>
<content type='text'>
The si-peephole-sdwa pass adjusts the selections on sdwa instructions to
the selections on their operands during its conversions. For instance,
if an instruction selects `BYTE_0` and its operand selects `WORD_1`, the
combined selection should be `BYTE_2`, i.e. "`BYTE_0` of `WORD_1`". The
existing implementation does not always handle this correctly in some
complex situations with instructions across different basic blocks as
demonstrated by the test cases included in this PR.

This PR adds an additional selection combination step to the conversion
to fix this issue. It reverts the changes made by PR #123942 which had
disabled the conversion of preexisting SDWA instructions completely as a
quick fix.

---------

Co-authored-by: Jeffrey Byrnes &lt;Jeffrey.Byrnes@amd.com&gt;
Co-authored-by: Matt Arsenault &lt;arsenm2@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The si-peephole-sdwa pass adjusts the selections on sdwa instructions to
the selections on their operands during its conversions. For instance,
if an instruction selects `BYTE_0` and its operand selects `WORD_1`, the
combined selection should be `BYTE_2`, i.e. "`BYTE_0` of `WORD_1`". The
existing implementation does not always handle this correctly in some
complex situations with instructions across different basic blocks as
demonstrated by the test cases included in this PR.

This PR adds an additional selection combination step to the conversion
to fix this issue. It reverts the changes made by PR #123942 which had
disabled the conversion of preexisting SDWA instructions completely as a
quick fix.

---------

Co-authored-by: Jeffrey Byrnes &lt;Jeffrey.Byrnes@amd.com&gt;
Co-authored-by: Matt Arsenault &lt;arsenm2@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[AMDGPU] SIPeepholeSDWA: Disable on existing SDWA instructions (#124131)</title>
<updated>2025-01-24T08:12:32+00:00</updated>
<author>
<name>Frederik Harwath</name>
<email>frederik.harwath@amd.com</email>
</author>
<published>2025-01-24T08:12:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=bfd9bc274586b0261e16e22ac50d50586a0152e2'/>
<id>bfd9bc274586b0261e16e22ac50d50586a0152e2</id>
<content type='text'>
This PR reapplies the changes from PR #123942 which had to be reverted
because of a test failure. The test has been adjusted.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This PR reapplies the changes from PR #123942 which had to be reverted
because of a test failure. The test has been adjusted.</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[AMDGPU] SIPeepholeSDWA: Disable on existing SDWA instructions (#123942)"</title>
<updated>2025-01-23T14:19:42+00:00</updated>
<author>
<name>Nico Weber</name>
<email>thakis@chromium.org</email>
</author>
<published>2025-01-23T14:19:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=99d450e9f51683bad608bf801e1b29e5c54b8917'/>
<id>99d450e9f51683bad608bf801e1b29e5c54b8917</id>
<content type='text'>
This reverts commit 6fdaaafd89d7cbc15dafe3ebf1aa3235d148aaab.
Breaks check-llvm, see
https://github.com/llvm/llvm-project/pull/123942#issuecomment-2609861953
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 6fdaaafd89d7cbc15dafe3ebf1aa3235d148aaab.
Breaks check-llvm, see
https://github.com/llvm/llvm-project/pull/123942#issuecomment-2609861953
</pre>
</div>
</content>
</entry>
<entry>
<title>[AMDGPU] SIPeepholeSDWA: Disable on existing SDWA instructions (#123942)</title>
<updated>2025-01-23T13:32:01+00:00</updated>
<author>
<name>Frederik Harwath</name>
<email>frederik.harwath@amd.com</email>
</author>
<published>2025-01-23T13:32:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=6fdaaafd89d7cbc15dafe3ebf1aa3235d148aaab'/>
<id>6fdaaafd89d7cbc15dafe3ebf1aa3235d148aaab</id>
<content type='text'>
This is meant as a short-term workaround for an invalid conversion in
this pass that occurs because existing SDWA selections are not correctly
taken into account during the conversion.

See the draft PR #123221 for an attempt to fix the actual issue.

---------

Co-authored-by: Frederik Harwath &lt;fharwath@amd.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is meant as a short-term workaround for an invalid conversion in
this pass that occurs because existing SDWA selections are not correctly
taken into account during the conversion.

See the draft PR #123221 for an attempt to fix the actual issue.

---------

Co-authored-by: Frederik Harwath &lt;fharwath@amd.com&gt;</pre>
</div>
</content>
</entry>
</feed>
