<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp, branch main</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>[NFC][InstCombine] Make use of `unknown` profile info clear in the API name (#162766)</title>
<updated>2025-10-10T16:33:45+00:00</updated>
<author>
<name>Mircea Trofin</name>
<email>mtrofin@google.com</email>
</author>
<published>2025-10-10T16:33:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=8aa49974df0cc27ca28e5e50bfd275a480e84182'/>
<id>8aa49974df0cc27ca28e5e50bfd275a480e84182</id>
<content type='text'>
Making the choice more clear from the API name, otherwise it'd be very easy for one to just "not bother" with the `MDFrom`​, especially since it is optional and follows the optional `Name`​ - but this time we'd have a harder time detecting it's effectivelly dropped metadata.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Making the choice more clear from the API name, otherwise it'd be very easy for one to just "not bother" with the `MDFrom`​, especially since it is optional and follows the optional `Name`​ - but this time we'd have a harder time detecting it's effectivelly dropped metadata.</pre>
</div>
</content>
</entry>
<entry>
<title>[InstCombine] Set !prof metadata on Selects identified by add.ll test (#158743)</title>
<updated>2025-09-29T20:37:06+00:00</updated>
<author>
<name>Alan Zhao</name>
<email>ayzhao@google.com</email>
</author>
<published>2025-09-29T20:37:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=045e09f22b6149bb8288e458a465f1b16cb88b77'/>
<id>045e09f22b6149bb8288e458a465f1b16cb88b77</id>
<content type='text'>
These select instructions are created from non-branching instructions,
so their branch weights are unknown.

Tracking issue: #147390</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These select instructions are created from non-branching instructions,
so their branch weights are unknown.

Tracking issue: #147390</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] Infer exact for lshr by cttz (#136696)</title>
<updated>2025-04-29T15:50:53+00:00</updated>
<author>
<name>黃國庭</name>
<email>we3223@gmail.com</email>
</author>
<published>2025-04-29T15:50:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=f37ab152540d374ceff8551abef3de5110e697ee'/>
<id>f37ab152540d374ceff8551abef3de5110e697ee</id>
<content type='text'>
Infer the 'exact' flag on an 'lshr' or 'ashr' instruction when the shift
amount is computed via a 'cttz' intrinsic on the same operand.
 
Proof: https://alive2.llvm.org/ce/z/CQR2PG

Fixes #131444.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Infer the 'exact' flag on an 'lshr' or 'ashr' instruction when the shift
amount is computed via a 'cttz' intrinsic on the same operand.
 
Proof: https://alive2.llvm.org/ce/z/CQR2PG

Fixes #131444.</pre>
</div>
</content>
</entry>
<entry>
<title>[InstCombine] Fold shift+cttz with power of 2 operands (#127055)</title>
<updated>2025-02-18T07:06:56+00:00</updated>
<author>
<name>Matthew Devereau</name>
<email>matthew.devereau@arm.com</email>
</author>
<published>2025-02-18T07:06:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=251377c47d296000158347d6a1cba2e6b30132a3'/>
<id>251377c47d296000158347d6a1cba2e6b30132a3</id>
<content type='text'>
#121386 Introduced cttz intrinsics which caused a regression where
vscale/vscale divisions could no longer be constant folded.

This fold was suggested as a fix in #126411.
https://alive2.llvm.org/ce/z/gWbtPw</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
#121386 Introduced cttz intrinsics which caused a regression where
vscale/vscale divisions could no longer be constant folded.

This fold was suggested as a fix in #126411.
https://alive2.llvm.org/ce/z/gWbtPw</pre>
</div>
</content>
</entry>
<entry>
<title>[NFC][DebugInfo] Use iterator moveBefore at many call-sites (#123583)</title>
<updated>2025-01-24T10:53:11+00:00</updated>
<author>
<name>Jeremy Morse</name>
<email>jeremy.morse@sony.com</email>
</author>
<published>2025-01-24T10:53:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=8e702735090388a3231a863e343f880d0f96fecb'/>
<id>8e702735090388a3231a863e343f880d0f96fecb</id>
<content type='text'>
As part of the "RemoveDIs" project, BasicBlock::iterator now carries a
debug-info bit that's needed when getFirstNonPHI and similar feed into
instruction insertion positions. Call-sites where that's necessary were
updated a year ago; but to ensure some type safety however, we'd like to
have all calls to moveBefore use iterators.

This patch adds a (guaranteed dereferenceable) iterator-taking
moveBefore, and changes a bunch of call-sites where it's obviously safe
to change to use it by just calling getIterator() on an instruction
pointer. A follow-up patch will contain less-obviously-safe changes.

We'll eventually deprecate and remove the instruction-pointer
insertBefore, but not before adding concise documentation of what
considerations are needed (very few).</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As part of the "RemoveDIs" project, BasicBlock::iterator now carries a
debug-info bit that's needed when getFirstNonPHI and similar feed into
instruction insertion positions. Call-sites where that's necessary were
updated a year ago; but to ensure some type safety however, we'd like to
have all calls to moveBefore use iterators.

This patch adds a (guaranteed dereferenceable) iterator-taking
moveBefore, and changes a bunch of call-sites where it's obviously safe
to change to use it by just calling getIterator() on an instruction
pointer. A follow-up patch will contain less-obviously-safe changes.

We'll eventually deprecate and remove the instruction-pointer
insertBefore, but not before adding concise documentation of what
considerations are needed (very few).</pre>
</div>
</content>
</entry>
<entry>
<title>[InstCombine] Prevent infinite loop with two shifts (#118806)</title>
<updated>2024-12-05T15:57:27+00:00</updated>
<author>
<name>Maurice Heumann</name>
<email>MauriceHeumann@gmail.com</email>
</author>
<published>2024-12-05T15:57:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=27eaa8a40ef338bea611f693fa8e810b1fc8d78d'/>
<id>27eaa8a40ef338bea611f693fa8e810b1fc8d78d</id>
<content type='text'>
The following pattern: `(C2 &lt;&lt; X) &lt;&lt; C1` will usually be transformed
into `(C2 &lt;&lt; C1) &lt;&lt; X`, essentially swapping `X` and `C1`.

However, this should only be done when `C1` is an immediate constant,
otherwise thiscan lead to both constants being swapped forever.

This fixes #118798.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The following pattern: `(C2 &lt;&lt; X) &lt;&lt; C1` will usually be transformed
into `(C2 &lt;&lt; C1) &lt;&lt; X`, essentially swapping `X` and `C1`.

However, this should only be done when `C1` is an immediate constant,
otherwise thiscan lead to both constants being swapped forever.

This fixes #118798.</pre>
</div>
</content>
</entry>
<entry>
<title> [InstCombine] Fold `[l|a]shr iN (X-1)&amp;~X, N-1 -&gt; [z|s]ext(X==0)` (#107259)</title>
<updated>2024-09-06T13:37:50+00:00</updated>
<author>
<name>Yingwei Zheng</name>
<email>dtcxzyw2333@gmail.com</email>
</author>
<published>2024-09-06T13:37:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=52fac608bd3fb93caf08c137cea4591372aa8f31'/>
<id>52fac608bd3fb93caf08c137cea4591372aa8f31</id>
<content type='text'>
Alive2: https://alive2.llvm.org/ce/z/kwvTFn
Closes #107228.

`ashr iN (X-1)&amp;~X, N-1` also exists. See
https://github.com/dtcxzyw/llvm-opt-benchmark/issues/1274.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Alive2: https://alive2.llvm.org/ce/z/kwvTFn
Closes #107228.

`ashr iN (X-1)&amp;~X, N-1` also exists. See
https://github.com/dtcxzyw/llvm-opt-benchmark/issues/1274.</pre>
</div>
</content>
</entry>
<entry>
<title>[InstCombine] Fold `ucmp/scmp(x, y) &gt;&gt; N` to `zext/sext(x &lt; y)` when N is one less than the width of the result of `ucmp/scmp` (#104009)</title>
<updated>2024-08-15T17:08:23+00:00</updated>
<author>
<name>Volodymyr Vasylkun</name>
<email>vvmposeydon@gmail.com</email>
</author>
<published>2024-08-15T17:08:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=d68d2172f9f1f0659b8b4bdbbeb1ccd290a614b5'/>
<id>d68d2172f9f1f0659b8b4bdbbeb1ccd290a614b5</id>
<content type='text'>
Proof: https://alive2.llvm.org/ce/z/4diUqN

---------

Co-authored-by: Nikita Popov &lt;github@npopov.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Proof: https://alive2.llvm.org/ce/z/4diUqN

---------

Co-authored-by: Nikita Popov &lt;github@npopov.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[PatternMatch] Use m_Not instead of m_c_Xor with m_AllOnes() (#96837)</title>
<updated>2024-06-27T08:14:45+00:00</updated>
<author>
<name>AtariDreams</name>
<email>gfunni234@gmail.com</email>
</author>
<published>2024-06-27T08:14:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=7a969ec1e114b6674c08e82ca048a3c4576bf0dd'/>
<id>7a969ec1e114b6674c08e82ca048a3c4576bf0dd</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
