<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/test/Transforms/DFAJumpThreading/dfa-jump-threading-transform.ll, 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>[DFAJumpThreading] Try harder to avoid cycles in paths. (#169151)</title>
<updated>2025-11-22T18:59:27+00:00</updated>
<author>
<name>Usman Nadeem</name>
<email>mnadeem@qti.qualcomm.com</email>
</author>
<published>2025-11-22T18:59:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=8baa5bf499e6bf2f43ec7fddf9601524159ec5ea'/>
<id>8baa5bf499e6bf2f43ec7fddf9601524159ec5ea</id>
<content type='text'>
If a threading path has cycles within it then the transformation is not
correct. This patch fixes a couple of cases that create such cycles.

Fixes https://github.com/llvm/llvm-project/issues/166868</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If a threading path has cycles within it then the transformation is not
correct. This patch fixes a couple of cases that create such cycles.

Fixes https://github.com/llvm/llvm-project/issues/166868</pre>
</div>
</content>
</entry>
<entry>
<title>[DFAJumpThreading] Don't insert existing edge to DomTree while unfolding (#163296)</title>
<updated>2025-10-14T16:52:39+00:00</updated>
<author>
<name>Usman Nadeem</name>
<email>mnadeem@quicinc.com</email>
</author>
<published>2025-10-14T16:52:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=f275d2b05777edf00779963e2519d231afb33b4a'/>
<id>f275d2b05777edf00779963e2519d231afb33b4a</id>
<content type='text'>
The edge `StartBlock -&gt; EndBlock` already exists before unfolding.

The instructions for `applyUpdates()` say that you are supposed not
to insert an existing edge.

Fixes issues reported by @mikaelholmen in
https://github.com/llvm/llvm-project/pull/162802</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The edge `StartBlock -&gt; EndBlock` already exists before unfolding.

The instructions for `applyUpdates()` say that you are supposed not
to insert an existing edge.

Fixes issues reported by @mikaelholmen in
https://github.com/llvm/llvm-project/pull/162802</pre>
</div>
</content>
</entry>
<entry>
<title>[DFAJumpThreading] Verify dominator tree by option (#163334)</title>
<updated>2025-10-14T11:52:16+00:00</updated>
<author>
<name>Hongyu Chen</name>
<email>xxs_chy@outlook.com</email>
</author>
<published>2025-10-14T11:52:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=90cbc37905665151216a8b9074ac5e9a411e22c7'/>
<id>90cbc37905665151216a8b9074ac5e9a411e22c7</id>
<content type='text'>
Note that the test coverage misses the dominator tree verification. This
patch controls verification by option, instead of using the
EXPENSIVE_CHECKS macro.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Note that the test coverage misses the dominator tree verification. This
patch controls verification by option, instead of using the
EXPENSIVE_CHECKS macro.</pre>
</div>
</content>
</entry>
<entry>
<title>[DFAJT][profcheck] Propagate `select` -&gt; `br` profile metadata (#162213)</title>
<updated>2025-10-07T16:28:04+00:00</updated>
<author>
<name>Mircea Trofin</name>
<email>mtrofin@google.com</email>
</author>
<published>2025-10-07T16:28:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=278a99e8e9f0baf17b99f4989d2bfa3777fa4d6f'/>
<id>278a99e8e9f0baf17b99f4989d2bfa3777fa4d6f</id>
<content type='text'>
Issue #147390</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Issue #147390</pre>
</div>
</content>
</entry>
<entry>
<title>[DFAJumpThreading] Unfold select to the incoming block of phi user (#160987)</title>
<updated>2025-10-01T14:06:08+00:00</updated>
<author>
<name>Hongyu Chen</name>
<email>xxs_chy@outlook.com</email>
</author>
<published>2025-10-01T14:06:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a05e004b285af92f9bcef12d5ab5537c36002c13'/>
<id>a05e004b285af92f9bcef12d5ab5537c36002c13</id>
<content type='text'>
Fixes #160250
We previously assumed the select to unfold is defined in the incoming
block of phi user, as `isValidSelectInst` filters other cases at the
initial stage. However, the selects not defined in the incoming block
may occur after unfolding the arms of the unfolded select.
This patch sinks the select into the incoming block of the phi user and
unfolds it at the incoming block.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes #160250
We previously assumed the select to unfold is defined in the incoming
block of phi user, as `isValidSelectInst` filters other cases at the
initial stage. However, the selects not defined in the incoming block
may occur after unfolding the arms of the unfolded select.
This patch sinks the select into the incoming block of the phi user and
unfolds it at the incoming block.</pre>
</div>
</content>
</entry>
<entry>
<title>[DFAJumpThreading] Handle select unfolding when user phi is not a dir… (#109511)</title>
<updated>2024-09-24T15:54:36+00:00</updated>
<author>
<name>Usman Nadeem</name>
<email>mnadeem@quicinc.com</email>
</author>
<published>2024-09-24T15:54:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=d4a38c8ff5c993e14c42895b51a47272fb03a857'/>
<id>d4a38c8ff5c993e14c42895b51a47272fb03a857</id>
<content type='text'>
…ect successor

Previously the code assumed that the select instruction is defined in a
block that is a direct predecessor of the block where the PHINode uses
it. So, we were hitting an assertion when we tried to access the def
block as an incoming block for the user phi node.

This patch handles that case by using the correct end block and creating
a new phi node that aggregates both the values of the select in that end
block, and then using that new unfolded phi to overwrite the original
user phi node.

Fixes #106083

Change-Id: Ie471994cca232318f74a6e6438efa21e561c2dc0</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
…ect successor

Previously the code assumed that the select instruction is defined in a
block that is a direct predecessor of the block where the PHINode uses
it. So, we were hitting an assertion when we tried to access the def
block as an incoming block for the user phi node.

This patch handles that case by using the correct end block and creating
a new phi node that aggregates both the values of the select in that end
block, and then using that new unfolded phi to overwrite the original
user phi node.

Fixes #106083

Change-Id: Ie471994cca232318f74a6e6438efa21e561c2dc0</pre>
</div>
</content>
</entry>
<entry>
<title>[DFAJumpThreading] Rewrite the way paths are enumerated (#96127)</title>
<updated>2024-08-10T19:13:53+00:00</updated>
<author>
<name>Usman Nadeem</name>
<email>mnadeem@quicinc.com</email>
</author>
<published>2024-08-10T19:13:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=b167ada89631fc18e073c2b6295b10e3085b8c88'/>
<id>b167ada89631fc18e073c2b6295b10e3085b8c88</id>
<content type='text'>
I tried to add a limit to number of blocks visited in the paths()
function but even with a very high limit the transformation coverage was
being reduced.

After looking at the code it seemed that the function was trying to
create paths of the form
`SwitchBB...DeterminatorBB...SwitchPredecessor`. This is inefficient
because a lot of nodes in those paths (nodes before DeterminatorBB)
would be irrelevant to the optimization. We only care about paths of the
form `DeterminatorBB_Pred DeterminatorBB...SwitchBB`. This weeds out a
lot of visited nodes.

In this patch I have added a hard limit to the number of nodes visited
and changed the algorithm for path calculation. Primarily I am
traversing the use-def chain for the PHI nodes that define the state. If
we have a hole in the use-def chain (no immediate predecessors) then I
call the paths() function.

I also had to the change the select instruction unfolding code to insert
redundant one input PHIs to allow the use of the use-def chain in
calculating the paths.

The test suite coverage with this patch (including a limit on nodes
visited) is as follows:

    Geomean diff:
      dfa-jump-threading.NumTransforms: +13.4%
      dfa-jump-threading.NumCloned: +34.1%
      dfa-jump-threading.NumPaths: -80.7%

Compile time effect vs baseline (pass enabled by default) is mostly
positive:
https://llvm-compile-time-tracker.com/compare.php?from=ad8705fda25f64dcfeb6264ac4d6bac36bee91ab&amp;to=5a3af6ce7e852f0736f706b4a8663efad5bce6ea&amp;stat=instructions:u

Change-Id: I0fba9e0f8aa079706f633089a8ccd4ecf57547ed</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
I tried to add a limit to number of blocks visited in the paths()
function but even with a very high limit the transformation coverage was
being reduced.

After looking at the code it seemed that the function was trying to
create paths of the form
`SwitchBB...DeterminatorBB...SwitchPredecessor`. This is inefficient
because a lot of nodes in those paths (nodes before DeterminatorBB)
would be irrelevant to the optimization. We only care about paths of the
form `DeterminatorBB_Pred DeterminatorBB...SwitchBB`. This weeds out a
lot of visited nodes.

In this patch I have added a hard limit to the number of nodes visited
and changed the algorithm for path calculation. Primarily I am
traversing the use-def chain for the PHI nodes that define the state. If
we have a hole in the use-def chain (no immediate predecessors) then I
call the paths() function.

I also had to the change the select instruction unfolding code to insert
redundant one input PHIs to allow the use of the use-def chain in
calculating the paths.

The test suite coverage with this patch (including a limit on nodes
visited) is as follows:

    Geomean diff:
      dfa-jump-threading.NumTransforms: +13.4%
      dfa-jump-threading.NumCloned: +34.1%
      dfa-jump-threading.NumPaths: -80.7%

Compile time effect vs baseline (pass enabled by default) is mostly
positive:
https://llvm-compile-time-tracker.com/compare.php?from=ad8705fda25f64dcfeb6264ac4d6bac36bee91ab&amp;to=5a3af6ce7e852f0736f706b4a8663efad5bce6ea&amp;stat=instructions:u

Change-Id: I0fba9e0f8aa079706f633089a8ccd4ecf57547ed</pre>
</div>
</content>
</entry>
<entry>
<title>[DFAJumpThreading][NFC] Reduce tests</title>
<updated>2024-01-16T04:25:08+00:00</updated>
<author>
<name>XChy</name>
<email>xxs_chy@outlook.com</email>
</author>
<published>2024-01-16T04:22:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=43414e736cd122032c07d60ca990655733e52a89'/>
<id>43414e736cd122032c07d60ca990655733e52a89</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[DFAJumpThreading] Handle circular determinator (#78177)</title>
<updated>2024-01-16T01:52:53+00:00</updated>
<author>
<name>XChy</name>
<email>xxs_chy@outlook.com</email>
</author>
<published>2024-01-16T01:52:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=2c0fc0f37f29d54e0376a5e1f7cbb386a37a177d'/>
<id>2c0fc0f37f29d54e0376a5e1f7cbb386a37a177d</id>
<content type='text'>
Fixes the buildbot failure in
https://github.com/llvm/llvm-project/pull/78134#issuecomment-1892195197
When we meet the path with single `determinator`, the determinator
actually takes itself as a predecessor. Thus, we need to let `Prev` be
the determinator when `PathBBs` has only one element.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes the buildbot failure in
https://github.com/llvm/llvm-project/pull/78134#issuecomment-1892195197
When we meet the path with single `determinator`, the determinator
actually takes itself as a predecessor. Thus, we need to let `Prev` be
the determinator when `PathBBs` has only one element.</pre>
</div>
</content>
</entry>
<entry>
<title>[DFAJumpThreading] Extends the bitwidth of state from uint64_t to APInt (#78134)</title>
<updated>2024-01-15T10:24:18+00:00</updated>
<author>
<name>XChy</name>
<email>xxs_chy@outlook.com</email>
</author>
<published>2024-01-15T10:24:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=019ffbf32469b6fd2e75efc154d9480d00b593bd'/>
<id>019ffbf32469b6fd2e75efc154d9480d00b593bd</id>
<content type='text'>
Fixes #78059</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes #78059</pre>
</div>
</content>
</entry>
</feed>
