History log of /llvm-project-15.0.7/llvm/lib/Transforms/Scalar/LoopDeletion.cpp (Results 1 – 25 of 157)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-20.1.0, llvmorg-20.1.0-rc3, llvmorg-20.1.0-rc2, llvmorg-20.1.0-rc1, llvmorg-21-init, llvmorg-19.1.7, llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init, llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7, llvmorg-15.0.6, llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, llvmorg-15.0.2, llvmorg-15.0.1, llvmorg-15.0.0, llvmorg-15.0.0-rc3, llvmorg-15.0.0-rc2, llvmorg-15.0.0-rc1, llvmorg-16-init
# 0586d1ca 30-Jun-2022 Nuno Lopes <[email protected]>

[NFC] Switch a few uses of undef to poison as placeholders for unreachble code


Revision tags: llvmorg-14.0.6, llvmorg-14.0.5
# b8c2781f 09-Jun-2022 Simon Moll <[email protected]>

[NFC] format InstructionSimplify & lowerCaseFunctionNames

Clang-format InstructionSimplify and convert all "FunctionName"s to
"functionName". This patch does touch a lot of files but gets done with

[NFC] format InstructionSimplify & lowerCaseFunctionNames

Clang-format InstructionSimplify and convert all "FunctionName"s to
"functionName". This patch does touch a lot of files but gets done with
the cleanup of InstructionSimplify in one commit.

This is the alternative to the less invasive clang-format only patch: D126783

Reviewed By: spatel, rengolin

Differential Revision: https://reviews.llvm.org/D126889

show more ...


Revision tags: llvmorg-14.0.4, llvmorg-14.0.3, llvmorg-14.0.2, llvmorg-14.0.1, llvmorg-14.0.0, llvmorg-14.0.0-rc4, llvmorg-14.0.0-rc3
# 59630917 02-Mar-2022 serge-sans-paille <[email protected]>

Cleanup includes: Transform/Scalar

Estimated impact on preprocessor output line:
before: 1062981579
after: 1062494547

Discourse thread: https://discourse.llvm.org/t/include-what-you-use-include-cl

Cleanup includes: Transform/Scalar

Estimated impact on preprocessor output line:
before: 1062981579
after: 1062494547

Discourse thread: https://discourse.llvm.org/t/include-what-you-use-include-cleanup
Differential Revision: https://reviews.llvm.org/D120817

show more ...


Revision tags: llvmorg-14.0.0-rc2, llvmorg-14.0.0-rc1, llvmorg-15-init, llvmorg-13.0.1, llvmorg-13.0.1-rc3
# 6ca192de 17-Jan-2022 Philip Reames <[email protected]>

[LoopDeletion] Add back statistic update lost in 523573e

Caught by a couple of builders as an unused variable warning (e.g. https://lab.llvm.org/buildbot#builders/57/builds/13973).


# 523573e9 17-Jan-2022 Philip Reames <[email protected]>

[LoopDeletion] Revert 3af8a11 and add test coverage for breakage

This reverts 3af8a11 because I'd used an upper bound where an lower bound was required. The included reduced test case demonstrates

[LoopDeletion] Revert 3af8a11 and add test coverage for breakage

This reverts 3af8a11 because I'd used an upper bound where an lower bound was required. The included reduced test case demonstrates the issue.

show more ...


Revision tags: llvmorg-13.0.1-rc2, llvmorg-13.0.1-rc1
# 0ae7bf12 29-Oct-2021 Roman Lebedev <[email protected]>

[NFC][LoopDeletion] Count the number of broken backedges

Those don't contribute to the number of deleted loops.


# 4c0da236 09-Oct-2021 Max Kazantsev <[email protected]>

[LoopDeletion] Support selects when symbolically evaluating 1st iteration

Adds support for selects for which we know value on the 1st iteration.

Differential Revision: https://reviews.llvm.org/D104

[LoopDeletion] Support selects when symbolically evaluating 1st iteration

Adds support for selects for which we know value on the 1st iteration.

Differential Revision: https://reviews.llvm.org/D104111
Reviewed By: nikic

show more ...


Revision tags: llvmorg-13.0.0, llvmorg-13.0.0-rc4, llvmorg-13.0.0-rc3
# 71815728 03-Sep-2021 Max Kazantsev <[email protected]>

[LoopDeletion] Move ICmpInst handling to getValueOnFirstIteration()

As noticed in https://reviews.llvm.org/D105688, it would be great to move
handling of ICmpInst which was in canProveExitOnFirstIte

[LoopDeletion] Move ICmpInst handling to getValueOnFirstIteration()

As noticed in https://reviews.llvm.org/D105688, it would be great to move
handling of ICmpInst which was in canProveExitOnFirstIteration() to
getValueOnFirstIteration().

Patch by Dmitry Makogon!

Differential Revision: https://reviews.llvm.org/D108978
Reviewed By: reames

show more ...


# 3af8a11b 01-Sep-2021 Philip Reames <[email protected]>

[LoopDeletion] Separate logic in breakBackedgeIfNotTaken using symboic max trip count [nfc]

As mentioned in D108833, the logic for figuring out if a backedge is dead was somewhat interwoven with the

[LoopDeletion] Separate logic in breakBackedgeIfNotTaken using symboic max trip count [nfc]

As mentioned in D108833, the logic for figuring out if a backedge is dead was somewhat interwoven with the SCEV based logic and the symbolic eval logic. This is my attempt at making the code easier to follow.

Note that this is only NFC after the work done in 29fa37ec. Thanks to Nikita for catching that case.

Differential Revision: https://reviews.llvm.org/D108848

show more ...


# c7b25e43 27-Aug-2021 Philip Reames <[email protected]>

[LoopDeletion] Use max trip count to break backedge in addition to exact one

We'd added support a while back from breaking the backedge if SCEV can prove the trip count is zero. However, we used the

[LoopDeletion] Use max trip count to break backedge in addition to exact one

We'd added support a while back from breaking the backedge if SCEV can prove the trip count is zero. However, we used the exact trip count which requires *all* exits be analyzeable. I noticed while writing test cases for another patch that this disallows cases where one exit is provably taken paired with another which is unknown. This patch adds the upper bound case.

We could use a symbolic max trip count here instead, but we use an isKnownNonZero filter (presumably for compile time?) for the first-iteration reasoning. I decided this was a more obvious incremental step, and we could go back and untangle the schemes separately.

Differential Revision: https://reviews.llvm.org/D108833

show more ...


Revision tags: llvmorg-13.0.0-rc2, llvmorg-13.0.0-rc1, llvmorg-14-init
# 9c5e6569 09-Jul-2021 Max Kazantsev <[email protected]>

[LoopDeletion] Handle switch in proving that loop exits on first iteration

Added check for switch-terminated blocks in loops.
Now if a block is terminated with a switch, we try to find out which of

[LoopDeletion] Handle switch in proving that loop exits on first iteration

Added check for switch-terminated blocks in loops.
Now if a block is terminated with a switch, we try to find out which of the
cases is taken on 1st iteration and mark corresponding edge from the block
to the case successor as live.

Patch by Dmitry Makogon!

Differential Revision: https://reviews.llvm.org/D105688
Reviewed By: nikic, mkazantsev

show more ...


# 19885c7a 07-Jul-2021 Max Kazantsev <[email protected]>

[NFC] Remove duplicate function calls

Removed repeated call of L->getHeader(). Now using previously stored return value.

Patch by Dmitry Makogon!

Differential Revision: https://reviews.llvm.org/D1

[NFC] Remove duplicate function calls

Removed repeated call of L->getHeader(). Now using previously stored return value.

Patch by Dmitry Makogon!

Differential Revision: https://reviews.llvm.org/D105535
Reviewed By: mkazantsev

show more ...


Revision tags: llvmorg-12.0.1, llvmorg-12.0.1-rc4
# 7c73c2ed 28-Jun-2021 Max Kazantsev <[email protected]>

[LoopDeletion] Benefit from branches by undef conditions when symbolically executing 1st iteration

We can exploit branches by `undef` condition. Frankly, the LangRef says that
such branches are UB,

[LoopDeletion] Benefit from branches by undef conditions when symbolically executing 1st iteration

We can exploit branches by `undef` condition. Frankly, the LangRef says that
such branches are UB, so we can assume that all outgoing edges of such blocks
are dead.

However, from practical perspective, we know that this is not supported correctly
in some other places. So we are being conservative about it.

Branch by undef is treated in the following way:
- If it is a loop-exiting branch, we always assume it exits the loop;
- If not, we arbitrarily assume it takes `true` value.

Differential Revision: https://reviews.llvm.org/D104689
Reviewed By: nikic

show more ...


Revision tags: llvmorg-12.0.1-rc3
# 842b4c83 23-Jun-2021 Max Kazantsev <[email protected]>

[LoopDeletion] Exploit undef Phi inputs when symbolically executing 1st iteration

Follow-up on Roman's idea expressed in D103959.
- If a Phi has undefined inputs from live blocks:
- and no other

[LoopDeletion] Exploit undef Phi inputs when symbolically executing 1st iteration

Follow-up on Roman's idea expressed in D103959.
- If a Phi has undefined inputs from live blocks:
- and no other inputs, assume it is undef itself;
- and exactly one non-undef input, we can assume that all undefs are equal to this input.

Differential Revision: https://reviews.llvm.org/D104618
Reviewed By: lebedev.ri, nikic

show more ...


# 4c4f1ae9 22-Jun-2021 Max Kazantsev <[email protected]>

Re-land "[LoopDeletion] Handle Phis with similar inputs from different blocks"

Patch was reverted due to a bug that existed before it and was exposed
by it. Returning after the underlying bug has be

Re-land "[LoopDeletion] Handle Phis with similar inputs from different blocks"

Patch was reverted due to a bug that existed before it and was exposed
by it. Returning after the underlying bug has been fixed.

Differential Revision: https://reviews.llvm.org/D103959

show more ...


# 57525388 22-Jun-2021 Max Kazantsev <[email protected]>

[LoopDeletion] Require loop to have a predecessor when executing 1st iteration symbolically

Two predecessors break the further logic, and the loop may come to the
opt in non-canonicalized state.


# f5266698 21-Jun-2021 Nathan Chancellor <[email protected]>

Revert "[LoopDeletion] Handle Phis with similar inputs from different blocks"

This reverts commit bb1dc876ebb8a2eef38d5183d00c2db1437f1c91.

This patch causes an assertion failure when building an a

Revert "[LoopDeletion] Handle Phis with similar inputs from different blocks"

This reverts commit bb1dc876ebb8a2eef38d5183d00c2db1437f1c91.

This patch causes an assertion failure when building an arm64 defconfig
Linux kernel.

See https://reviews.llvm.org/D103959 for a link to the original bug
report and a reduced reproducer.

show more ...


# bb1dc876 21-Jun-2021 Max Kazantsev <[email protected]>

[LoopDeletion] Handle Phis with similar inputs from different blocks

This patch lifts the requirement to have the only incoming live block
for Phis. There can be multiple live blocks if the same val

[LoopDeletion] Handle Phis with similar inputs from different blocks

This patch lifts the requirement to have the only incoming live block
for Phis. There can be multiple live blocks if the same value comes to
phi from all of them.

Differential Revision: https://reviews.llvm.org/D103959
Reviewed By: nikic, lebedev.ri

show more ...


# de92287c 18-Jun-2021 Max Kazantsev <[email protected]>

[LoopDeletion] Break backedge if we can prove that the loop is exited on 1st iteration (try 3)

This patch handles one particular case of one-iteration loops for which SCEV
cannot straightforwardly p

[LoopDeletion] Break backedge if we can prove that the loop is exited on 1st iteration (try 3)

This patch handles one particular case of one-iteration loops for which SCEV
cannot straightforwardly prove BECount = 1. The idea of the optimization is to
symbolically execute conditional branches on the 1st iteration, moving in topoligical
order, and only visiting blocks that may be reached on the first iteration. If we find out
that we never reach header via the latch, then the backedge can be broken.

This implementation uses InstSimplify. SCEV version was rejected due to high
compile time impact.

Differential Revision: https://reviews.llvm.org/D102615
Reviewed By: nikic

show more ...


Revision tags: llvmorg-12.0.1-rc2
# f7fc8927 15-Jun-2021 Florian Hahn <[email protected]>

[LoopDeletion] Check for irreducible cycles when deleting loops.

Loops with irreducible cycles may loop infinitely. Those cannot be
removed, unless the loop/function is marked as mustprogress.

Also

[LoopDeletion] Check for irreducible cycles when deleting loops.

Loops with irreducible cycles may loop infinitely. Those cannot be
removed, unless the loop/function is marked as mustprogress.

Also discussed in D103382.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D104238

show more ...


# 1b84acb2 01-Jun-2021 Florian Hahn <[email protected]>

[LoopDeletion] Consider infinite loops alive, unless mustprogress.

The current loop or any of its sub-loops may be infinite. Unless the
function or the loops are marked as mustprogress, this in itse

[LoopDeletion] Consider infinite loops alive, unless mustprogress.

The current loop or any of its sub-loops may be infinite. Unless the
function or the loops are marked as mustprogress, this in itself makes
the loop *not* dead.

This patch moves the logic to check whether the current loop is finite
or mustprogress to `isLoopDead` and also extends it to check the
sub-loops. This should fix PR50511.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D103382

show more ...


# 01596520 28-May-2021 Stefan Pintilie <[email protected]>

Revert "Return "[LoopDeletion] Break backedge if we can prove that the loop is exited on 1st iteration" (try 2)"

This reverts commit be1a23203b1de655b8c7dac7549818d975a0cbbf.


# 24bd6572 28-May-2021 Stefan Pintilie <[email protected]>

Revert "[NFCI][LoopDeletion] Only query SCEV about loop successor if another successor is also in loop"

This reverts commit b0b2bf3b5da950679db1431aae431a6dedea2245.


# fd553312 28-May-2021 Stefan Pintilie <[email protected]>

Revert "[NFC] Formatting fix"

This reverts commit 59d938e649e62db0cef4903d495e838fbc6a6eb8.


# 807fc7cd 28-May-2021 Stefan Pintilie <[email protected]>

Revert "[NFC] Reuse existing variables instead of re-requesting successors"

This reverts commit c467585682dcdda75e645ef3ab47c8b48440db12.


1234567