<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/lib/Transforms/Utils/SCCPSolver.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>[SCCP] Support constant structure in PhiNode (#163713)</title>
<updated>2025-10-19T03:57:56+00:00</updated>
<author>
<name>aokblast</name>
<email>aokblast@FreeBSD.org</email>
</author>
<published>2025-10-19T03:57:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a3082c9d9004e2017c86a76cdf91ba02d2f84bce'/>
<id>a3082c9d9004e2017c86a76cdf91ba02d2f84bce</id>
<content type='text'>
This patch adds support for constant propagation of individual structure
members through Phi nodes. Each member is handled independently,
allowing optimization opportunities when specific members become
constant.

Also, update the testcase since we are able to optimize the call
parameter now.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch adds support for constant propagation of individual structure
members through Phi nodes. Each member is handled independently,
allowing optimization opportunities when specific members become
constant.

Also, update the testcase since we are able to optimize the call
parameter now.</pre>
</div>
</content>
</entry>
<entry>
<title>[LVI][SCCP] Avoid copying ValueLatticeElement (#163901)</title>
<updated>2025-10-18T16:58:05+00:00</updated>
<author>
<name>Yingwei Zheng</name>
<email>dtcxzyw2333@gmail.com</email>
</author>
<published>2025-10-18T16:58:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=5d22980ed46c175848e8f9e896216eb64e0f54a7'/>
<id>5d22980ed46c175848e8f9e896216eb64e0f54a7</id>
<content type='text'>
Copying ValueLatticeElement becomes expensive after
https://github.com/llvm/llvm-project/pull/111544. This patch eliminates
some redundant copies to improve performance. The code change has been
carefully reviewed to ensure that there is no dangling reference.

Compile-time improvement:
https://llvm-compile-time-tracker.com/compare.php?from=f4359301c033694d36865c7560714164d2050240&amp;to=4ea449bd53feef43403c35d8b815ddca752dbc17&amp;stat=instructions%3Au</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Copying ValueLatticeElement becomes expensive after
https://github.com/llvm/llvm-project/pull/111544. This patch eliminates
some redundant copies to improve performance. The code change has been
carefully reviewed to ensure that there is no dangling reference.

Compile-time improvement:
https://llvm-compile-time-tracker.com/compare.php?from=f4359301c033694d36865c7560714164d2050240&amp;to=4ea449bd53feef43403c35d8b815ddca752dbc17&amp;stat=instructions%3Au</pre>
</div>
</content>
</entry>
<entry>
<title>[SCCP] Strengthen two-instruction range checks (#162008)</title>
<updated>2025-10-06T07:14:46+00:00</updated>
<author>
<name>Yingwei Zheng</name>
<email>dtcxzyw2333@gmail.com</email>
</author>
<published>2025-10-06T07:14:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=5e92e7f4c0fb9ab92572fb974591d52266be8fc6'/>
<id>5e92e7f4c0fb9ab92572fb974591d52266be8fc6</id>
<content type='text'>
This patch implements the todo discussed in
https://github.com/llvm/llvm-project/pull/158495#discussion_r2349609838.
It also fixes a regression introduced by
https://github.com/llvm/llvm-project/pull/161000. See also
https://github.com/dtcxzyw/llvm-opt-benchmark/pull/2890#discussion_r2404016316.

IR diff: https://github.com/dtcxzyw/llvm-opt-benchmark/pull/2892</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch implements the todo discussed in
https://github.com/llvm/llvm-project/pull/158495#discussion_r2349609838.
It also fixes a regression introduced by
https://github.com/llvm/llvm-project/pull/161000. See also
https://github.com/dtcxzyw/llvm-opt-benchmark/pull/2890#discussion_r2404016316.

IR diff: https://github.com/dtcxzyw/llvm-opt-benchmark/pull/2892</pre>
</div>
</content>
</entry>
<entry>
<title>[SCCP] Relax two-instruction range checks (#158495)</title>
<updated>2025-09-17T15:50:38+00:00</updated>
<author>
<name>Yingwei Zheng</name>
<email>dtcxzyw2333@gmail.com</email>
</author>
<published>2025-09-17T15:50:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=05c4681668d0acd15a5a06e91be94916acd1c799'/>
<id>05c4681668d0acd15a5a06e91be94916acd1c799</id>
<content type='text'>
If we know x in R1, the range check `x in R2` can be relaxed into `x in
Union(R2, Inverse(R1))`. The latter one may be more efficient if we can
represent it with one icmp.
Fixes regressions introduced by
https://github.com/llvm/llvm-project/pull/156497.

Proof for `(X &amp; -Pow2) == C -&gt; (X - C) &lt; Pow2`:
https://alive2.llvm.org/ce/z/HMgkuu

Compile-time impact:
https://llvm-compile-time-tracker.com/compare.php?from=ead4f3e271fdf6918aef2ede3a7134811147d276&amp;to=bee3d902dd505cf9b11499ba4f230e4e8ae96b92&amp;stat=instructions%3Au</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If we know x in R1, the range check `x in R2` can be relaxed into `x in
Union(R2, Inverse(R1))`. The latter one may be more efficient if we can
represent it with one icmp.
Fixes regressions introduced by
https://github.com/llvm/llvm-project/pull/156497.

Proof for `(X &amp; -Pow2) == C -&gt; (X - C) &lt; Pow2`:
https://alive2.llvm.org/ce/z/HMgkuu

Compile-time impact:
https://llvm-compile-time-tracker.com/compare.php?from=ead4f3e271fdf6918aef2ede3a7134811147d276&amp;to=bee3d902dd505cf9b11499ba4f230e4e8ae96b92&amp;stat=instructions%3Au</pre>
</div>
</content>
</entry>
<entry>
<title>[SCCP] Add support for trunc nuw range. (#152990)</title>
<updated>2025-08-12T11:48:55+00:00</updated>
<author>
<name>Andreas Jonson</name>
<email>andjo403@hotmail.com</email>
</author>
<published>2025-08-12T11:48:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=1840106ddfb67f5fa1939f48e123fdd529eada50'/>
<id>1840106ddfb67f5fa1939f48e123fdd529eada50</id>
<content type='text'>
proof: https://alive2.llvm.org/ce/z/_7PVxq
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
proof: https://alive2.llvm.org/ce/z/_7PVxq
</pre>
</div>
</content>
</entry>
<entry>
<title>[PredicateInfo] Use bitcast instead of ssa.copy (#151174)</title>
<updated>2025-08-11T07:25:01+00:00</updated>
<author>
<name>Nikita Popov</name>
<email>npopov@redhat.com</email>
</author>
<published>2025-08-11T07:25:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=35bad229c1bc1f27fe58f9d37f8592fc67a7112c'/>
<id>35bad229c1bc1f27fe58f9d37f8592fc67a7112c</id>
<content type='text'>
PredicateInfo needs some no-op to which the predicate can be attached.
Currently this is an ssa.copy intrinsic. This PR replaces it with a
no-op bitcast.
    
Using a bitcast is more efficient because we don't have the overhead of
an overloaded intrinsic. It also makes things slightly simpler overall.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
PredicateInfo needs some no-op to which the predicate can be attached.
Currently this is an ssa.copy intrinsic. This PR replaces it with a
no-op bitcast.
    
Using a bitcast is more efficient because we don't have the overhead of
an overloaded intrinsic. It also makes things slightly simpler overall.</pre>
</div>
</content>
</entry>
<entry>
<title>[SCCP] Extract PredicateInfo handling into separate method (NFC)</title>
<updated>2025-07-29T14:36:33+00:00</updated>
<author>
<name>Nikita Popov</name>
<email>npopov@redhat.com</email>
</author>
<published>2025-07-29T14:16:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=fa6965f722e0573f62e4d1e533dfa5b3a2ce2c4f'/>
<id>fa6965f722e0573f62e4d1e533dfa5b3a2ce2c4f</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[SCCP] Simplify [us]cmp(X, Y) into X - Y (#144717)</title>
<updated>2025-07-20T07:01:44+00:00</updated>
<author>
<name>Yingwei Zheng</name>
<email>dtcxzyw2333@gmail.com</email>
</author>
<published>2025-07-20T07:01:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=9e587ce6f0da91ee71dd6920dff0930b291169bb'/>
<id>9e587ce6f0da91ee71dd6920dff0930b291169bb</id>
<content type='text'>
If the difference between [us]cmp's operands is not greater than 1, we
can simplify it into `X - Y`.
Alive2: https://alive2.llvm.org/ce/z/JS55so
llvm-opt-benchmark diff:
https://github.com/dtcxzyw/llvm-opt-benchmark/pull/2464/files</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If the difference between [us]cmp's operands is not greater than 1, we
can simplify it into `X - Y`.
Alive2: https://alive2.llvm.org/ce/z/JS55so
llvm-opt-benchmark diff:
https://github.com/dtcxzyw/llvm-opt-benchmark/pull/2464/files</pre>
</div>
</content>
</entry>
<entry>
<title>[SCCP] Improve worklist management (#146321)</title>
<updated>2025-06-30T15:17:30+00:00</updated>
<author>
<name>Nikita Popov</name>
<email>npopov@redhat.com</email>
</author>
<published>2025-06-30T15:17:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=545cdca4883552b147a0f1adfac713f76fc22305'/>
<id>545cdca4883552b147a0f1adfac713f76fc22305</id>
<content type='text'>
SCCP currently stores instructions whose lattice value has changed in a
worklist, and then updates their users in the main loop. This may result
in instructions unnecessarily being visited multiple times (as an
instruction will often use multiple other instructions). Additionally,
we'd often redundantly visit instructions that were already visited when
the containing block first became executable.

Instead, change the worklist to directly store the instructions that
need to be revisited. Additionally, do not add instructions to the
worklist that will already be covered by the main basic block walk.

This change is conceptually NFC, but is expected to produce minor
differences in practice, because the visitation order interacts with the
range widening limit.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
SCCP currently stores instructions whose lattice value has changed in a
worklist, and then updates their users in the main loop. This may result
in instructions unnecessarily being visited multiple times (as an
instruction will often use multiple other instructions). Additionally,
we'd often redundantly visit instructions that were already visited when
the containing block first became executable.

Instead, change the worklist to directly store the instructions that
need to be revisited. Additionally, do not add instructions to the
worklist that will already be covered by the main basic block walk.

This change is conceptually NFC, but is expected to produce minor
differences in practice, because the visitation order interacts with the
range widening limit.</pre>
</div>
</content>
</entry>
<entry>
<title>[PredicateInfo] Use BumpPtrAllocator for predicates (NFC) (#145692)</title>
<updated>2025-06-26T07:04:41+00:00</updated>
<author>
<name>Nikita Popov</name>
<email>npopov@redhat.com</email>
</author>
<published>2025-06-26T07:04:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=d46a69cab4e371a6dad38db637dde0c1d245f0ea'/>
<id>d46a69cab4e371a6dad38db637dde0c1d245f0ea</id>
<content type='text'>
Currently predicates are allocated on the heap and tracked with an
intrusive list. Use a bump pointer allocator instead, which is more
efficient. The list is no longer needed, as we don't have to track
predicates for freeing.

The bump pointer allocator is provided as a parameter for PredicateInfo
to allow reusing the same allocator for all functions during IPSCCP.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently predicates are allocated on the heap and tracked with an
intrusive list. Use a bump pointer allocator instead, which is more
efficient. The list is no longer needed, as we don't have to track
predicates for freeing.

The bump pointer allocator is provided as a parameter for PredicateInfo
to allow reusing the same allocator for all functions during IPSCCP.</pre>
</div>
</content>
</entry>
</feed>
