<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/lib/Transforms/InstCombine/InstCombineCalls.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>[InstCombine] Pull vector reverse through intrinsics (#146384)</title>
<updated>2025-07-01T15:49:10+00:00</updated>
<author>
<name>Luke Lau</name>
<email>luke@igalia.com</email>
</author>
<published>2025-07-01T15:49:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=04c614327c28339ed4204b3e100a695f14fe754c'/>
<id>04c614327c28339ed4204b3e100a695f14fe754c</id>
<content type='text'>
This is the intrinsic version of #146349, and handles fabs as well as
other intrinsics.

It's largely a copy of InstCombinerImpl::foldShuffledIntrinsicOperands
but a bit simpler since we don't need to find a common mask.

Creating a separate function seems to be cleaner than trying to shoehorn
it into the existing one.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is the intrinsic version of #146349, and handles fabs as well as
other intrinsics.

It's largely a copy of InstCombinerImpl::foldShuffledIntrinsicOperands
but a bit simpler since we don't need to find a common mask.

Creating a separate function seems to be cleaner than trying to shoehorn
it into the existing one.</pre>
</div>
</content>
</entry>
<entry>
<title>[InstCombine] Pull vector reverse through fneg (#146349)</title>
<updated>2025-06-30T15:15:04+00:00</updated>
<author>
<name>Luke Lau</name>
<email>luke@igalia.com</email>
</author>
<published>2025-06-30T15:15:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=6f7370ced630ec1994456a979ca10ac26e3dc0a7'/>
<id>6f7370ced630ec1994456a979ca10ac26e3dc0a7</id>
<content type='text'>
This follows on from
https://github.com/llvm/llvm-project/pull/144933#issuecomment-2992372627,
and allows us to remove the reverse (fneg (reverse x)) combine.

A separate patch will handle the case for fabs. I haven't checked if we
perform this canonicalization for either unops or binops for vp.reverse</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This follows on from
https://github.com/llvm/llvm-project/pull/144933#issuecomment-2992372627,
and allows us to remove the reverse (fneg (reverse x)) combine.

A separate patch will handle the case for fabs. I haven't checked if we
perform this canonicalization for either unops or binops for vp.reverse</pre>
</div>
</content>
</entry>
<entry>
<title>[InstCombine] smin(smax(X, -1), 1) -&gt; scmp(X, 0) and smax(smin(X, 1), -1) -&gt; scmp(X, 0) (#145736)</title>
<updated>2025-06-30T13:44:37+00:00</updated>
<author>
<name>AZero13</name>
<email>gfunni234@gmail.com</email>
</author>
<published>2025-06-30T13:44:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=8c7719183558695b3f9e088351f4a88fda46e1b4'/>
<id>8c7719183558695b3f9e088351f4a88fda46e1b4</id>
<content type='text'>
Motivating case: https://godbolt.org/z/Wxcc51jcj

Alive2: https://alive2.llvm.org/ce/z/-bPPAg</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Motivating case: https://godbolt.org/z/Wxcc51jcj

Alive2: https://alive2.llvm.org/ce/z/-bPPAg</pre>
</div>
</content>
</entry>
<entry>
<title>[InstCombine] Pull unary shuffles through fneg/fabs (#144933)</title>
<updated>2025-06-30T09:40:12+00:00</updated>
<author>
<name>Luke Lau</name>
<email>luke@igalia.com</email>
</author>
<published>2025-06-30T09:40:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=d0c1ea928c5c4a99689ff3dcbf1ca578d56b80a3'/>
<id>d0c1ea928c5c4a99689ff3dcbf1ca578d56b80a3</id>
<content type='text'>
This canonicalizes fneg/fabs (shuffle X, poison, mask) -&gt; shuffle
(fneg/fabs X), posion, mask

This undoes part of b331a7ebc1e02f9939d1a4a1509e7eb6cdda3d38 and
a8f13dbdeb31be37ee15b5febb7cc2137bbece67, but keeps the binary shuffle
case i.e. shuffle fneg, fneg, mask.

By pulling out the shuffle we bring it inline with the same
canonicalisation we perform on binary ops and intrinsics, which the
original commit acknowledges it goes in the opposite direction.

However nowadays VectorCombine is more powerful and can do more
optimisations when the shuffle is pulled out, so I think we should
revisit this. In particular we get more shuffles folded and can perform
scalarization.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This canonicalizes fneg/fabs (shuffle X, poison, mask) -&gt; shuffle
(fneg/fabs X), posion, mask

This undoes part of b331a7ebc1e02f9939d1a4a1509e7eb6cdda3d38 and
a8f13dbdeb31be37ee15b5febb7cc2137bbece67, but keeps the binary shuffle
case i.e. shuffle fneg, fneg, mask.

By pulling out the shuffle we bring it inline with the same
canonicalisation we perform on binary ops and intrinsics, which the
original commit acknowledges it goes in the opposite direction.

However nowadays VectorCombine is more powerful and can do more
optimisations when the shuffle is pulled out, so I think we should
revisit this. In particular we get more shuffles folded and can perform
scalarization.
</pre>
</div>
</content>
</entry>
<entry>
<title>[InstCombine] Implement vp.reverse reordering/elimination through binop/unop (#143963)</title>
<updated>2025-06-18T15:53:45+00:00</updated>
<author>
<name>Philip Reames</name>
<email>preames@rivosinc.com</email>
</author>
<published>2025-06-18T15:53:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=b5aaf9d988ff2dc652c86271b181bf0497eb97cb'/>
<id>b5aaf9d988ff2dc652c86271b181bf0497eb97cb</id>
<content type='text'>
This simply copies the structure of the vector.reverse patterns from
just above, and reimplements them for the vp.reverse intrinsics when the
mask is all ones and the EVLs exactly match.

Its unfortunate that we have three different ways to represent a reverse
(shuffle, vector.reverse, and vp.reverse) but I don't see an obvious way
to remove any them because the semantics are slightly different.

This significantly improves vectorization in TSVC_2's s112 and s1112
loops when using EVL tail folding.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This simply copies the structure of the vector.reverse patterns from
just above, and reimplements them for the vp.reverse intrinsics when the
mask is all ones and the EVLs exactly match.

Its unfortunate that we have three different ways to represent a reverse
(shuffle, vector.reverse, and vp.reverse) but I don't see an obvious way
to remove any them because the semantics are slightly different.

This significantly improves vectorization in TSVC_2's s112 and s1112
loops when using EVL tail folding.</pre>
</div>
</content>
</entry>
<entry>
<title>[instcombine] Delete dead transform for reverse of binop (#143967)</title>
<updated>2025-06-16T19:43:13+00:00</updated>
<author>
<name>Philip Reames</name>
<email>preames@rivosinc.com</email>
</author>
<published>2025-06-16T19:43:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=25781221d68a700eae679a19f701d4ad67e91dc9'/>
<id>25781221d68a700eae679a19f701d4ad67e91dc9</id>
<content type='text'>
We canonicalize reverse to after a binop in foldVectorBinop, and
simplify reverse pairs in InstSimplify, so these elimination transforms
are redundant.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We canonicalize reverse to after a binop in foldVectorBinop, and
simplify reverse pairs in InstSimplify, so these elimination transforms
are redundant.</pre>
</div>
</content>
</entry>
<entry>
<title>[InstCombine] Fold shuffles through all trivially vectorizable intrinsics (#141979)</title>
<updated>2025-06-13T17:25:07+00:00</updated>
<author>
<name>Luke Lau</name>
<email>luke@igalia.com</email>
</author>
<published>2025-06-13T17:25:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=b81d5e06c7cba8c9f1f5380daed4b9ee139214ba'/>
<id>b81d5e06c7cba8c9f1f5380daed4b9ee139214ba</id>
<content type='text'>
This addresses a TODO in foldShuffledIntrinsicOperands to use
isTriviallyVectorizable instead of a hardcoded list of intrinsics, which
in turn allows more intriniscs to be scalarized by VectorCombine.

From what I can tell every intrinsic here should be speculatable so an
assertion was added.

Because this enables intrinsics like abs which have a scalar operand, we
need to also check isVectorIntrinsicWithScalarOpAtArg.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This addresses a TODO in foldShuffledIntrinsicOperands to use
isTriviallyVectorizable instead of a hardcoded list of intrinsics, which
in turn allows more intriniscs to be scalarized by VectorCombine.

From what I can tell every intrinsic here should be speculatable so an
assertion was added.

Because this enables intrinsics like abs which have a scalar operand, we
need to also check isVectorIntrinsicWithScalarOpAtArg.</pre>
</div>
</content>
</entry>
<entry>
<title>[AArch64][InstCombine] Combine AES instructions with zero operands. (#142781)</title>
<updated>2025-06-09T07:27:58+00:00</updated>
<author>
<name>Ricardo Jesus</name>
<email>rjj@nvidia.com</email>
</author>
<published>2025-06-09T07:27:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c70c0a86a5b7b4c51d3be5ebbcc5cf291af4d843'/>
<id>c70c0a86a5b7b4c51d3be5ebbcc5cf291af4d843</id>
<content type='text'>
We currently combine (AES (EOR (A, B)), 0) into (AES A, B) for Neon
intrinsics when the zero operand appears in the RHS of the AES
instruction.

This patch extends the combine to support AES SVE intrinsics and
the case where the zero operand appears in the LHS of the AES
instructions.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We currently combine (AES (EOR (A, B)), 0) into (AES A, B) for Neon
intrinsics when the zero operand appears in the RHS of the AES
instruction.

This patch extends the combine to support AES SVE intrinsics and
the case where the zero operand appears in the LHS of the AES
instructions.</pre>
</div>
</content>
</entry>
<entry>
<title>[ValueTracking] Make Depth last default arg (NFC) (#142384)</title>
<updated>2025-06-03T16:12:24+00:00</updated>
<author>
<name>Ramkumar Ramachandra</name>
<email>ramkumar.ramachandra@codasip.com</email>
</author>
<published>2025-06-03T16:12:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=b40e4ceaa61c5f14ca261e2952e7f85a066403e2'/>
<id>b40e4ceaa61c5f14ca261e2952e7f85a066403e2</id>
<content type='text'>
Having a finite Depth (or recursion limit) for computeKnownBits is very
limiting, but is currently a load-bearing necessity, as all KnownBits
are recomputed on each call and there is no caching. As a prerequisite
for an effort to remove the recursion limit altogether, either using a
clever caching technique, or writing a easily-invalidable KnownBits
analysis, make the Depth argument in APIs in ValueTracking uniformly the
last argument with a default value. This would aid in removing the
argument when the time comes, as many callers that currently pass 0
explicitly are now updated to omit the argument altogether.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Having a finite Depth (or recursion limit) for computeKnownBits is very
limiting, but is currently a load-bearing necessity, as all KnownBits
are recomputed on each call and there is no caching. As a prerequisite
for an effort to remove the recursion limit altogether, either using a
clever caching technique, or writing a easily-invalidable KnownBits
analysis, make the Depth argument in APIs in ValueTracking uniformly the
last argument with a default value. This would aid in removing the
argument when the time comes, as many callers that currently pass 0
explicitly are now updated to omit the argument altogether.</pre>
</div>
</content>
</entry>
<entry>
<title>[InstCombine] Explicitly match poison operand. NFCI (#141744)</title>
<updated>2025-05-28T12:16:55+00:00</updated>
<author>
<name>Luke Lau</name>
<email>luke@igalia.com</email>
</author>
<published>2025-05-28T12:16:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=618a399f862b68d3f4e3c2f39a1265dad8fd0e2f'/>
<id>618a399f862b68d3f4e3c2f39a1265dad8fd0e2f</id>
<content type='text'>
This is a follow up from
https://github.com/llvm/llvm-project/pull/141300#discussion_r2109109224</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a follow up from
https://github.com/llvm/llvm-project/pull/141300#discussion_r2109109224</pre>
</div>
</content>
</entry>
</feed>
