<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.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: Directly select minimumnum/maximumnum with ieee_mode=0 (#141903)</title>
<updated>2025-06-17T15:27:41+00:00</updated>
<author>
<name>Matt Arsenault</name>
<email>Matthew.Arsenault@amd.com</email>
</author>
<published>2025-06-17T15:27:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c80282d333d7248c8a34694ce1bec9a40681c1c5'/>
<id>c80282d333d7248c8a34694ce1bec9a40681c1c5</id>
<content type='text'>
The hardware min/max follow the IR rules with IEEE mode disabled,
so we can avoid the canonicalizes of the input. We lose the quieting
of a signaling nan if both inputs are nans, but we only require that
with strictfp.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The hardware min/max follow the IR rules with IEEE mode disabled,
so we can avoid the canonicalizes of the input. We lose the quieting
of a signaling nan if both inputs are nans, but we only require that
with strictfp.</pre>
</div>
</content>
</entry>
<entry>
<title>[llvm] Compare std::optional&lt;T&gt; to values directly (NFC) (#143340)</title>
<updated>2025-06-09T05:37:59+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2025-06-09T05:37:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=03f616eb3acf1ae5a219ea247d9efe3cbfd41b59'/>
<id>03f616eb3acf1ae5a219ea247d9efe3cbfd41b59</id>
<content type='text'>
This patch transforms:

  X &amp;&amp; *X == Y

to:

  X == Y

where X is of std::optional&lt;T&gt;, and Y is of T or similar.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch transforms:

  X &amp;&amp; *X == Y

to:

  X == Y

where X is of std::optional&lt;T&gt;, and Y is of T or similar.</pre>
</div>
</content>
</entry>
<entry>
<title>AMDGPU: Custom lower fptrunc vectors for f32 -&gt; f16 (#141883)</title>
<updated>2025-06-06T22:15:24+00:00</updated>
<author>
<name>Changpeng Fang</name>
<email>changpeng.fang@amd.com</email>
</author>
<published>2025-06-06T22:15:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=70e78be7dc3e060457d121e4ef9ee2745bb6c41e'/>
<id>70e78be7dc3e060457d121e4ef9ee2745bb6c41e</id>
<content type='text'>
The latest asics support v_cvt_pk_f16_f32 instruction. However current
implementation of vector fptrunc lowering fully scalarizes the vectors,
and the scalar conversions may not always be combined to generate the
packed one.
We made v2f32 -&gt; v2f16 legal in
https://github.com/llvm/llvm-project/pull/139956. This work is an
extension to handle wider vectors. Instead of fully scalarization, we
split the vector to packs (v2f32 -&gt; v2f16) to ensure the packed
conversion can always been generated.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The latest asics support v_cvt_pk_f16_f32 instruction. However current
implementation of vector fptrunc lowering fully scalarizes the vectors,
and the scalar conversions may not always be combined to generate the
packed one.
We made v2f32 -&gt; v2f16 legal in
https://github.com/llvm/llvm-project/pull/139956. This work is an
extension to handle wider vectors. Instead of fully scalarization, we
split the vector to packs (v2f32 -&gt; v2f16) to ensure the packed
conversion can always been generated.</pre>
</div>
</content>
</entry>
<entry>
<title>Warn on misuse of DiagnosticInfo classes that hold Twines (#137397)</title>
<updated>2025-05-28T19:26:39+00:00</updated>
<author>
<name>Justin Bogner</name>
<email>mail@justinbogner.com</email>
</author>
<published>2025-05-28T19:26:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=b7bb2567032f2264715234bcd8ddf55414d99b5d'/>
<id>b7bb2567032f2264715234bcd8ddf55414d99b5d</id>
<content type='text'>
This annotates the `Twine` passed to the constructors of the various
DiagnosticInfo subclasses with `[[clang::lifetimebound]]`, which causes
us to warn when we would try to print the twine after it had already
been destructed.

We also update `DiagnosticInfoUnsupported` to hold a `const Twine &amp;`
like all of the other DiagnosticInfo classes, since this warning allows
us to clean up all of the places where it was being used incorrectly.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This annotates the `Twine` passed to the constructors of the various
DiagnosticInfo subclasses with `[[clang::lifetimebound]]`, which causes
us to warn when we would try to print the twine after it had already
been destructed.

We also update `DiagnosticInfoUnsupported` to hold a `const Twine &amp;`
like all of the other DiagnosticInfo classes, since this warning allows
us to clean up all of the places where it was being used incorrectly.</pre>
</div>
</content>
</entry>
<entry>
<title>[AMDGPU] Correct bitshift legality transformation for small vectors (#140940)</title>
<updated>2025-05-23T08:56:21+00:00</updated>
<author>
<name>zGoldthorpe</name>
<email>Zach.Goldthorpe@amd.com</email>
</author>
<published>2025-05-23T08:56:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=bb7e5597407884dbbd1d45570fa73dea168545f5'/>
<id>bb7e5597407884dbbd1d45570fa73dea168545f5</id>
<content type='text'>
Fix for a bug found by the AMD fuzzing project.

The legaliser would originally try to widen a small vector such as `&lt;4 x
i1&gt;` to a single `i16` during the legalisation of bitshifts, as it was
not originally written with consideration for vector operands. This
patch simply adds a guard to prohibit this transformation and allow
other legalisation transformations to step in.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix for a bug found by the AMD fuzzing project.

The legaliser would originally try to widen a small vector such as `&lt;4 x
i1&gt;` to a single `i16` during the legalisation of bitshifts, as it was
not originally written with consideration for vector operands. This
patch simply adds a guard to prohibit this transformation and allow
other legalisation transformations to step in.</pre>
</div>
</content>
</entry>
<entry>
<title>AMDGPU/GlobalISel: Start legalizing minimumnum and maximumnum (#140900)</title>
<updated>2025-05-21T15:00:45+00:00</updated>
<author>
<name>Matt Arsenault</name>
<email>Matthew.Arsenault@amd.com</email>
</author>
<published>2025-05-21T15:00:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=2e2bbcacf813de52f6e7f48dea67e26de1f1f99e'/>
<id>2e2bbcacf813de52f6e7f48dea67e26de1f1f99e</id>
<content type='text'>
This is the bare minimum to get the intrinsic to compile for AMDGPU,
and it's not optimal. We need to follow along closer with the existing
G_FMINNUM/G_FMAXNUM with custom lowering to handle the IEEE=0 case
better.

Just re-use the existing lowering for the old semantics for
G_FMINNUM/G_FMAXNUM. This does not change G_FMINNUM/G_FMAXNUM's
treatment,
nor try to handle the general expansion without an underlying min/max
variant (or with G_FMINIMUM/G_FMAXIMUM).</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is the bare minimum to get the intrinsic to compile for AMDGPU,
and it's not optimal. We need to follow along closer with the existing
G_FMINNUM/G_FMAXNUM with custom lowering to handle the IEEE=0 case
better.

Just re-use the existing lowering for the old semantics for
G_FMINNUM/G_FMAXNUM. This does not change G_FMINNUM/G_FMAXNUM's
treatment,
nor try to handle the general expansion without an underlying min/max
variant (or with G_FMINIMUM/G_FMAXIMUM).</pre>
</div>
</content>
</entry>
<entry>
<title>[GlobalISel][AMDGPU] Fix handling of v2i128 type for AND, OR, XOR (#138574)</title>
<updated>2025-05-08T17:31:28+00:00</updated>
<author>
<name>Chinmay Deshpande</name>
<email>chdeshpa@amd.com</email>
</author>
<published>2025-05-08T17:31:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=3a5af231fd3af4b5890ed28f7792b17e56386ffd'/>
<id>3a5af231fd3af4b5890ed28f7792b17e56386ffd</id>
<content type='text'>
Current behavior crashes the compiler.

This bug was found using the AMDGPU Fuzzing project.

Fixes SWDEV-508816.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Current behavior crashes the compiler.

This bug was found using the AMDGPU Fuzzing project.

Fixes SWDEV-508816.</pre>
</div>
</content>
</entry>
<entry>
<title>[AMDGPU][Legalizer] Widen i16 G_SEXT_INREG (#131308)</title>
<updated>2025-05-07T08:22:15+00:00</updated>
<author>
<name>Pierre van Houtryve</name>
<email>pierre.vanhoutryve@amd.com</email>
</author>
<published>2025-05-07T08:22:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=0d0eed419fa362e1932b694e01534f4012dcea97'/>
<id>0d0eed419fa362e1932b694e01534f4012dcea97</id>
<content type='text'>
It's better to widen them to avoid it being lowered into a G_ASHR + G_SHL. With this change we just extend to i32 then trunc the result.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It's better to widen them to avoid it being lowered into a G_ASHR + G_SHL. With this change we just extend to i32 then trunc the result.</pre>
</div>
</content>
</entry>
<entry>
<title>[AMDGPU] Support arbitrary types in amdgcn.dead (#134841)</title>
<updated>2025-05-05T12:08:00+00:00</updated>
<author>
<name>Diana Picus</name>
<email>Diana-Magda.Picus@amd.com</email>
</author>
<published>2025-05-05T12:08:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=45d96df7976ffa9eb5b951fc0f8f481ea6c43610'/>
<id>45d96df7976ffa9eb5b951fc0f8f481ea6c43610</id>
<content type='text'>
Legalize the amdgcn.dead intrinsic to work with types other than i32. It
still generates IMPLICIT_DEFs.

Remove some of the previous code for selecting/reg bank mapping it for
32-bit types, since everything is done in the legalizer now.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Legalize the amdgcn.dead intrinsic to work with types other than i32. It
still generates IMPLICIT_DEFs.

Remove some of the previous code for selecting/reg bank mapping it for
32-bit types, since everything is done in the legalizer now.</pre>
</div>
</content>
</entry>
<entry>
<title>AMDGPU: Fix the double rounding issue in v2f64 -&gt; v2f16 conversion (#135659)</title>
<updated>2025-04-17T18:15:49+00:00</updated>
<author>
<name>Changpeng Fang</name>
<email>changpeng.fang@amd.com</email>
</author>
<published>2025-04-17T18:15:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=8b46b98b916050e739cf3b740526e5c2f6936dad'/>
<id>8b46b98b916050e739cf3b740526e5c2f6936dad</id>
<content type='text'>
On targets that support v_cvt_pk_f16_f32 instruction, if we make v2f64
-&gt; v2f16 Legal, we will generate the following sequence of instructions:
  v_cvt_f32_f64_e32 v1, s[6:7]
  v_cvt_f32_f64_e32 v2, s[4:5]
  v_cvt_pk_f16_f32 v1, v2, v1
It possibly returns imprecise results due to double rounding. This patch
fixes the issue by not setting the conversion Legal. While we may still
expect the above sequence of code when unsafe fpmath is set, I hope
https://github.com/llvm/llvm-project/pull/134738 can address that
performance concern.

Fixes: SWDEV-523856</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
On targets that support v_cvt_pk_f16_f32 instruction, if we make v2f64
-&gt; v2f16 Legal, we will generate the following sequence of instructions:
  v_cvt_f32_f64_e32 v1, s[6:7]
  v_cvt_f32_f64_e32 v2, s[4:5]
  v_cvt_pk_f16_f32 v1, v2, v1
It possibly returns imprecise results due to double rounding. This patch
fixes the issue by not setting the conversion Legal. While we may still
expect the above sequence of code when unsafe fpmath is set, I hope
https://github.com/llvm/llvm-project/pull/134738 can address that
performance concern.

Fixes: SWDEV-523856</pre>
</div>
</content>
</entry>
</feed>
