<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/lib/Transforms/Utils/LoopPeel.cpp, branch users/nico/python-1</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>[LoopPeel] Support last iteration peeling of min/max intrinsics (#143598)</title>
<updated>2025-06-17T18:22:23+00:00</updated>
<author>
<name>Philip Reames</name>
<email>preames@rivosinc.com</email>
</author>
<published>2025-06-17T18:22:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=bb288de4e0e74f235402ff41be60dabcd57e379f'/>
<id>bb288de4e0e74f235402ff41be60dabcd57e379f</id>
<content type='text'>
This isn't terribly useful at the moment because of the step=1
restriction but it should be functionally sound. This is mostly just
making sure the codepaths don't diverge as we make other changes.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This isn't terribly useful at the moment because of the step=1
restriction but it should be functionally sound. This is mostly just
making sure the codepaths don't diverge as we make other changes.</pre>
</div>
</content>
</entry>
<entry>
<title>[LoopPeel] Use loop guards when checking if last iter can be peeled. (#142605)</title>
<updated>2025-06-10T07:29:42+00:00</updated>
<author>
<name>Florian Hahn</name>
<email>flo@fhahn.com</email>
</author>
<published>2025-06-10T07:29:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=e5ff7055beb116f103f030d992fadea49c994511'/>
<id>e5ff7055beb116f103f030d992fadea49c994511</id>
<content type='text'>
Apply loop guards to BTC before checking if the last iteration should be
peeled off. This also adds an assert to make sure applying the guards
does not pessimize the results. I checked on a large test set and it did
not trigger there, but it adds an additional guard to catch potential
cases where loop-guards pessimize results.

Peels ~15% more loops.

PR: https://github.com/llvm/llvm-project/pull/142605</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Apply loop guards to BTC before checking if the last iteration should be
peeled off. This also adds an assert to make sure applying the guards
does not pessimize the results. I checked on a large test set and it did
not trigger there, but it adds an additional guard to catch potential
cases where loop-guards pessimize results.

Peels ~15% more loops.

PR: https://github.com/llvm/llvm-project/pull/142605</pre>
</div>
</content>
</entry>
<entry>
<title>[LoopPeel] Handle non-local instructions/arguments when updating exiting values (#142993)</title>
<updated>2025-06-06T04:56:28+00:00</updated>
<author>
<name>Yingwei Zheng</name>
<email>dtcxzyw2333@gmail.com</email>
</author>
<published>2025-06-06T04:56:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=4eac8daa38990871e50b804c0cc19a3ad9c98db2'/>
<id>4eac8daa38990871e50b804c0cc19a3ad9c98db2</id>
<content type='text'>
Similar to
https://github.com/llvm/llvm-project/commit/7e14161f49b32387988cf9d937bbfaa27d0fbdd5,
the exiting value may be a non-local instruction or an argument.

Closes https://github.com/llvm/llvm-project/issues/142895.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Similar to
https://github.com/llvm/llvm-project/commit/7e14161f49b32387988cf9d937bbfaa27d0fbdd5,
the exiting value may be a non-local instruction or an argument.

Closes https://github.com/llvm/llvm-project/issues/142895.</pre>
</div>
</content>
</entry>
<entry>
<title>Reapply "[LoopPeel] Remove known trip count restriction when peeling last. (#140792)"</title>
<updated>2025-05-28T12:02:03+00:00</updated>
<author>
<name>Florian Hahn</name>
<email>flo@fhahn.com</email>
</author>
<published>2025-05-28T12:01:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=f98bdd94e61721ebe11108956e63510692db34b2'/>
<id>f98bdd94e61721ebe11108956e63510692db34b2</id>
<content type='text'>
This reverts commit 580454526b936f7a576ddbc9bb932cf9be376ec4.

The recommitted version contains an extra check to not peel if the
latch exit is controlled by a pointer induction.

Original message:
Remove the restriction that the loop must be known to execute at least 2
iterations when peeling the last iteration. If we cannot prove at least
2 iterations are executed, a check and branch to skip the peeled loop is
inserted.

PR: https://github.com/llvm/llvm-project/pull/140792
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 580454526b936f7a576ddbc9bb932cf9be376ec4.

The recommitted version contains an extra check to not peel if the
latch exit is controlled by a pointer induction.

Original message:
Remove the restriction that the loop must be known to execute at least 2
iterations when peeling the last iteration. If we cannot prove at least
2 iterations are executed, a check and branch to skip the peeled loop is
inserted.

PR: https://github.com/llvm/llvm-project/pull/140792
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[LoopPeel] Remove known trip count restriction when peeling last. (#140792)"</title>
<updated>2025-05-27T20:25:32+00:00</updated>
<author>
<name>Florian Hahn</name>
<email>flo@fhahn.com</email>
</author>
<published>2025-05-27T20:25:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=580454526b936f7a576ddbc9bb932cf9be376ec4'/>
<id>580454526b936f7a576ddbc9bb932cf9be376ec4</id>
<content type='text'>
This reverts commit 24b97756decb7bf0e26dcf0e30a7a9aaf27f417c.
Also reverts ac9a466e39bf97ffeab127982aa7c405cb257551.

Building CMake triggers a crash with the patch, revert while I
investigate.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 24b97756decb7bf0e26dcf0e30a7a9aaf27f417c.
Also reverts ac9a466e39bf97ffeab127982aa7c405cb257551.

Building CMake triggers a crash with the patch, revert while I
investigate.
</pre>
</div>
</content>
</entry>
<entry>
<title>[LoopPeel] Insert new phis before first non-PHI when peeling last iter.</title>
<updated>2025-05-27T09:46:28+00:00</updated>
<author>
<name>Florian Hahn</name>
<email>flo@fhahn.com</email>
</author>
<published>2025-05-27T09:46:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=ac9a466e39bf97ffeab127982aa7c405cb257551'/>
<id>ac9a466e39bf97ffeab127982aa7c405cb257551</id>
<content type='text'>
Make sure the new phis are inserted before any non-phi instructions.
This fixes a crash when dbg_value instructions are present in the
original exit block.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Make sure the new phis are inserted before any non-phi instructions.
This fixes a crash when dbg_value instructions are present in the
original exit block.
</pre>
</div>
</content>
</entry>
<entry>
<title>[LoopPeel] Remove known trip count restriction when peeling last. (#140792)</title>
<updated>2025-05-26T19:08:02+00:00</updated>
<author>
<name>Florian Hahn</name>
<email>flo@fhahn.com</email>
</author>
<published>2025-05-26T19:08:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=24b97756decb7bf0e26dcf0e30a7a9aaf27f417c'/>
<id>24b97756decb7bf0e26dcf0e30a7a9aaf27f417c</id>
<content type='text'>
Remove the restriction that the loop must be known to execute at least 2
iterations when peeling the last iteration. If we cannot prove at least
2 iterations are executed, a check and branch to skip the peeled loop is
inserted.

PR: https://github.com/llvm/llvm-project/pull/140792</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove the restriction that the loop must be known to execute at least 2
iterations when peeling the last iteration. If we cannot prove at least
2 iterations are executed, a check and branch to skip the peeled loop is
inserted.

PR: https://github.com/llvm/llvm-project/pull/140792</pre>
</div>
</content>
</entry>
<entry>
<title>[LoopPeel] Make sure bound in exit condition is loop invariant.</title>
<updated>2025-05-25T18:21:49+00:00</updated>
<author>
<name>Florian Hahn</name>
<email>flo@fhahn.com</email>
</author>
<published>2025-05-25T18:21:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=364d80e5c52db2b001dc2807fb78b4e0df397f55'/>
<id>364d80e5c52db2b001dc2807fb78b4e0df397f55</id>
<content type='text'>
Follow-up to post-commit comment for
(https://github.com/llvm/llvm-project/pull/139551.

This should effectively be NFC, given the other existing restrictions.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Follow-up to post-commit comment for
(https://github.com/llvm/llvm-project/pull/139551.

This should effectively be NFC, given the other existing restrictions.
</pre>
</div>
</content>
</entry>
<entry>
<title>[LoopPeel] Make sure AddRec is for correct loop when peeling last iter.</title>
<updated>2025-05-25T11:05:06+00:00</updated>
<author>
<name>Florian Hahn</name>
<email>flo@fhahn.com</email>
</author>
<published>2025-05-25T11:05:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=f755e6644a5b321d16bf33bc525fff8dc59800fe'/>
<id>f755e6644a5b321d16bf33bc525fff8dc59800fe</id>
<content type='text'>
Follow-up to post-commit comment for
(https://github.com/llvm/llvm-project/pull/139551.

This should effectively be NFC, given the other existing restrictions.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Follow-up to post-commit comment for
(https://github.com/llvm/llvm-project/pull/139551.

This should effectively be NFC, given the other existing restrictions.
</pre>
</div>
</content>
</entry>
<entry>
<title>[LoopPeel] Make sure exit condition has a single use when peeling last.</title>
<updated>2025-05-18T10:47:12+00:00</updated>
<author>
<name>Florian Hahn</name>
<email>flo@fhahn.com</email>
</author>
<published>2025-05-18T10:47:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a0a2a1e095ddd092e668b0b3f9a7dfa9655255e1'/>
<id>a0a2a1e095ddd092e668b0b3f9a7dfa9655255e1</id>
<content type='text'>
Update the check in canPeelLastIteration to make sure the exiting
condition has a single use. When peeling the last iteration, we adjust
the condition in the loop body to be true one iteration early, which
would be incorrect for other users.

Fixes https://github.com/llvm/llvm-project/issues/140444.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Update the check in canPeelLastIteration to make sure the exiting
condition has a single use. When peeling the last iteration, we adjust
the condition in the loop body to be true one iteration early, which
would be incorrect for other users.

Fixes https://github.com/llvm/llvm-project/issues/140444.
</pre>
</div>
</content>
</entry>
</feed>
