Revision tags: 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 |
|
#
8b5b294e |
| 06-Mar-2024 |
Philip Reames <preames@rivosinc.com> |
[SCEV] Print predicate backedge count only if new information available
When printing the result of SCEV's analysis, we can avoid printing the predicated backedge taken count and the predicates if t
[SCEV] Print predicate backedge count only if new information available
When printing the result of SCEV's analysis, we can avoid printing the predicated backedge taken count and the predicates if the predicates are empty and no new information is provided. This helps to reduce the verbosity of the output.
show more ...
|
#
7755c261 |
| 06-Mar-2024 |
Philip Reames <preames@rivosinc.com> |
[SCEV] Include type when printing constant max backedge taken count
When printing the result of the analysis, i8 -1 and i64 -1 are quite different in terms of analysis quality. In a recent conversi
[SCEV] Include type when printing constant max backedge taken count
When printing the result of the analysis, i8 -1 and i64 -1 are quite different in terms of analysis quality. In a recent conversion with a new contributor, we ran into exactly this confusion.
Adding the type for constant scevs more globally seems worthwhile, but introduces a much larger test diff. I'm splitting this off first since it addresses the immediate need, and then going to do some further changes to clarify a few related bits of analysis result output.
show more ...
|
Revision tags: 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 |
|
#
88f7dc17 |
| 24-Nov-2023 |
Nikita Popov <npopov@redhat.com> |
[SCEV] Regenerate test checks (NFC)
There have been some minor but pervasive changes to the generated CHECK lines, so regenerate all of them, to minimize future diffs.
|
Revision tags: 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 |
|
#
3cd45714 |
| 23-Jun-2023 |
Nikita Popov <npopov@redhat.com> |
[SCEV] Make use of non-null pointers for range calculation
We know that certain pointers (e.g. non-extern-weak globals or allocas in default address space) are not null, in which case the lowest add
[SCEV] Make use of non-null pointers for range calculation
We know that certain pointers (e.g. non-extern-weak globals or allocas in default address space) are not null, in which case the lowest address they can be allocated at is their alignment.
This allows us to calculate better exit counts for loops that have an additional null check in the guarding condition (see alloca_icmp_null_exit_count).
Differential Revision: https://reviews.llvm.org/D153624
show more ...
|
#
406e9c93 |
| 23-Jun-2023 |
Nikita Popov <npopov@redhat.com> |
[SCEV] Use object size for allocas as well
The object size and alignment based restriction on the possible allocation range also applies to allocas, not just globals, so handle them as well.
We sho
[SCEV] Use object size for allocas as well
The object size and alignment based restriction on the possible allocation range also applies to allocas, not just globals, so handle them as well.
We shouldn't really need any type restriction here at all, but for now stay conservative.
show more ...
|
Revision tags: 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 |
|
#
cc19628e |
| 16-Dec-2022 |
Nikita Popov <npopov@redhat.com> |
[SCEV] Convert some tests to opaque pointers (NFC)
|
Revision tags: llvmorg-15.0.6 |
|
#
e5fa7eb1 |
| 24-Nov-2022 |
Max Kazantsev <mkazantsev@azul.com> |
[SCEV] Add printout of symbolic max backedge-taken and block exit count
We do compute it and use in optimizations, but never print it out. We need to do it in order to be able to track improvements
[SCEV] Add printout of symbolic max backedge-taken and block exit count
We do compute it and use in optimizations, but never print it out. We need to do it in order to be able to track improvements in its computation.
show more ...
|
#
211d9411 |
| 24-Nov-2022 |
Max Kazantsev <mkazantsev@azul.com> |
[SCEV] Rename max backedge-taken count -> constant max backedge taken-count in printout
This is a preparatory step for introducing symbolic max backedge-taken count.
|
Revision tags: llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, working, 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, llvmorg-14.0.6, llvmorg-14.0.5, 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, llvmorg-14.0.0-rc2, llvmorg-14.0.0-rc1, llvmorg-15-init, llvmorg-13.0.1, llvmorg-13.0.1-rc3, llvmorg-13.0.1-rc2, llvmorg-13.0.1-rc1 |
|
#
2ca8a3f2 |
| 01-Oct-2021 |
Philip Reames <listmail@philipreames.com> |
[SCEV] Stop blindly propagating flags from inbound geps to SCEV nodes
This fixes a violation of the wrap flag rules introduced in c4048d8f. This was also noted in the (very old) PR23527.
The issue
[SCEV] Stop blindly propagating flags from inbound geps to SCEV nodes
This fixes a violation of the wrap flag rules introduced in c4048d8f. This was also noted in the (very old) PR23527.
The issue being fixed is that we assume the inbound flag on any GEP assumes that all users of *any* gep (or add) which happens to map to that SCEV would also be UB if the (other) gep overflowed. That's simply not true.
In terms of the test diffs, I don't see anything seriously problematic. The lost flags are expected (given the semantic restriction on when its legal to tag the SCEV), and there are several cases where the previously inferred flags are unsound per the new semantics.
The only common trend I noticed when looking at the deltas is that by not considering branch on poison as immediate UB in ValueTracking, we do miss a few cases we could reclaim. We may be able to claw some of these back with the follow ideas mentioned in PR51817.
It's worth noting that most of the changes are analysis result only changes. The two transform changes are pretty minimal. In one case, we miss the opportunity to infer a nuw (correctly). In the other, we fail to fold an exit and produce a loop invariant form instead. This one is probably over-reduced as the program appears to be undefined in practice, and neither before or after exploits that.
Differential Revision: https://reviews.llvm.org/D109789
show more ...
|
Revision tags: llvmorg-13.0.0, llvmorg-13.0.0-rc4, llvmorg-13.0.0-rc3 |
|
#
50153213 |
| 01-Sep-2021 |
Arthur Eubanks <aeubanks@google.com> |
[test][NewPM] Remove RUN lines using -analyze
Only tests in llvm/test/Analysis.
-analyze is legacy PM-specific.
This only touches files with `-passes`.
I looked through everything and made sure t
[test][NewPM] Remove RUN lines using -analyze
Only tests in llvm/test/Analysis.
-analyze is legacy PM-specific.
This only touches files with `-passes`.
I looked through everything and made sure that everything had a new PM equivalent.
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D109040
show more ...
|
Revision tags: llvmorg-13.0.0-rc2, llvmorg-13.0.0-rc1, llvmorg-14-init, llvmorg-12.0.1, llvmorg-12.0.1-rc4, llvmorg-12.0.1-rc3, llvmorg-12.0.1-rc2, llvmorg-12.0.1-rc1, llvmorg-12.0.0, llvmorg-12.0.0-rc5, llvmorg-12.0.0-rc4, llvmorg-12.0.0-rc3, llvmorg-12.0.0-rc2, llvmorg-11.1.0, llvmorg-11.1.0-rc3, llvmorg-12.0.0-rc1, llvmorg-13-init, llvmorg-11.1.0-rc2, llvmorg-11.1.0-rc1, llvmorg-11.0.1, llvmorg-11.0.1-rc2, llvmorg-11.0.1-rc1 |
|
#
f3124a46 |
| 02-Nov-2020 |
Nikita Popov <nikita.ppv@gmail.com> |
[SCEV] Fix nsw flags for GEP expressions
The SCEV code for constructing GEP expressions currently assumes that the addition of the base and all the offsets is nsw if the GEP is inbounds. While the a
[SCEV] Fix nsw flags for GEP expressions
The SCEV code for constructing GEP expressions currently assumes that the addition of the base and all the offsets is nsw if the GEP is inbounds. While the addition of the offsets is indeed nsw, the addition to the base address is not, as the base address is interpreted as an unsigned value.
Fix the GEP expression code to not assume nsw for the base+offset calculation. However, do assume nuw if we know that the offset is non-negative. With this, we use the same behavior as the construction of GEP addrecs does. (Modulo the fact that we disregard SCEV unification, as the pre-existing FIXME points out).
Differential Revision: https://reviews.llvm.org/D90648
show more ...
|
#
6022a8b7 |
| 10-Nov-2020 |
Max Kazantsev <mkazantsev@azul.com> |
[SCEV] Drop cached ranges of AddRecs after flag update
Our range computation methods benefit from no-wrap flags. But if the ranges were first computed before the flags were set, the cached range wil
[SCEV] Drop cached ranges of AddRecs after flag update
Our range computation methods benefit from no-wrap flags. But if the ranges were first computed before the flags were set, the cached range will be too pessimistic.
We need to drop cached ranges whenever we sharpen AddRec's no wrap flags.
Differential Revision: https://reviews.llvm.org/D89847 Reviewed By: fhahn
show more ...
|
#
5ef84688 |
| 28-Oct-2020 |
Max Kazantsev <mkazantsev@azul.com> |
Re-enable "[SCEV] Prove implications of different type via truncation"
When we need to prove implication of expressions of different type width, the default strategy is to widen everything to wider
Re-enable "[SCEV] Prove implications of different type via truncation"
When we need to prove implication of expressions of different type width, the default strategy is to widen everything to wider type and prove in this type. This does not interact well with AddRecs with negative steps and unsigned predicates: such AddRec will likely not have a `nuw` flag, and its `zext` to wider type will not be an AddRec. In contraty, `trunc` of an AddRec in some cases can easily be proved to be an `AddRec` too.
This patch introduces an alternative way to handling implications of different type widths. If we can prove that wider type values actually fit in the narrow type, we truncate them and prove the implication in narrow type.
The return was due to revert of underlying patch that this one depends on.
Unit test temporarily disabled because the required logic in SCEV is switched off due to compile time reasons.
Differential Revision: https://reviews.llvm.org/D89548
show more ...
|
#
bed02fa8 |
| 21-Oct-2020 |
Max Kazantsev <mkazantsev@azul.com> |
Revert "[SCEV] Prove implications of different type via truncation"
This reverts commit 80852a4f2fb154c6094bb9d9e3457757d5a60ad1.
Test is now broken because underlying required patch was also rever
Revert "[SCEV] Prove implications of different type via truncation"
This reverts commit 80852a4f2fb154c6094bb9d9e3457757d5a60ad1.
Test is now broken because underlying required patch was also reverted SUDDENLY.
show more ...
|
#
80852a4f |
| 21-Oct-2020 |
Max Kazantsev <mkazantsev@azul.com> |
[SCEV] Prove implications of different type via truncation
When we need to prove implication of expressions of different type width, the default strategy is to widen everything to wider type and pro
[SCEV] Prove implications of different type via truncation
When we need to prove implication of expressions of different type width, the default strategy is to widen everything to wider type and prove in this type. This does not interact well with AddRecs with negative steps and unsigned predicates: such AddRec will likely not have a `nuw` flag, and its `zext` to wider type will not be an AddRec. In contraty, `trunc` of an AddRec in some cases can easily be proved to be an `AddRec` too.
This patch introduces an alternative way to handling implications of different type widths. If we can prove that wider type values actually fit in the narrow type, we truncate them and prove the implication in narrow type.
Differential Revision: https://reviews.llvm.org/D89548 Reviewed By: fhahn
show more ...
|
Revision tags: llvmorg-11.0.0, llvmorg-11.0.0-rc6, llvmorg-11.0.0-rc5, llvmorg-11.0.0-rc4, llvmorg-11.0.0-rc3, llvmorg-11.0.0-rc2, llvmorg-11.0.0-rc1 |
|
#
9adbb5cb |
| 16-Jul-2020 |
Arthur Eubanks <aeubanks@google.com> |
[SCEV] Fix ScalarEvolution tests under NPM
Many tests use opt's -analyze feature, which does not translate well to NPM and has better alternatives. The alternative here is to explicitly add a pass t
[SCEV] Fix ScalarEvolution tests under NPM
Many tests use opt's -analyze feature, which does not translate well to NPM and has better alternatives. The alternative here is to explicitly add a pass that calls ScalarEvolution::print().
The legacy pass manager RUNs aren't changing, but they are now pinned to the legacy pass manager. For each legacy pass manager RUN, I added a corresponding NPM RUN using the 'print<scalar-evolution>' pass. For compatibility with update_analyze_test_checks.py and existing test CHECKs, 'print<scalar-evolution>' now prints what -analyze prints per function.
This was generated by the following Python script and failures were manually fixed up:
import sys for i in sys.argv: with open(i, 'r') as f: s = f.read() with open(i, 'w') as f: for l in s.splitlines(): if "RUN:" in l and ' -analyze ' in l and '\\' not in l: f.write(l.replace(' -analyze ', ' -analyze -enable-new-pm=0 ')) f.write('\n') f.write(l.replace(' -analyze ', ' -disable-output ').replace(' -scalar-evolution ', ' "-passes=print<scalar-evolution>" ').replace(" | ", " 2>&1 | ")) f.write('\n') else: f.write(l)
There are a couple failures still in ScalarEvolution under NPM, but those are due to other unrelated naming conflicts.
Reviewed By: asbirlea
Differential Revision: https://reviews.llvm.org/D83798
show more ...
|
Revision tags: llvmorg-12-init, llvmorg-10.0.1, llvmorg-10.0.1-rc4, llvmorg-10.0.1-rc3 |
|
#
a2619a60 |
| 06-Jul-2020 |
Roman Lebedev <lebedev.ri@gmail.com> |
Reland "[ScalarEvolution] createSCEV(): recognize `udiv`/`urem` disguised as an `sdiv`/`srem`"
This reverts commit d3e3f36ff1151f565730977ac4f663a2ccee48ae, which reverter the original commit 2c1610
Reland "[ScalarEvolution] createSCEV(): recognize `udiv`/`urem` disguised as an `sdiv`/`srem`"
This reverts commit d3e3f36ff1151f565730977ac4f663a2ccee48ae, which reverter the original commit 2c16100e6f72075564ea1f67fa5a82c269dafcd3, but with polly tests now actually passing.
show more ...
|
#
d3e3f36f |
| 06-Jul-2020 |
Mikhail Goncharov <goncharov.mikhail@gmail.com> |
Revert "[ScalarEvolution] createSCEV(): recognize `udiv`/`urem` disguised as an `sdiv`/`srem`"
Summary: This reverts commit 2c16100e6f72075564ea1f67fa5a82c269dafcd3.
ninja check-polly fails: Poll
Revert "[ScalarEvolution] createSCEV(): recognize `udiv`/`urem` disguised as an `sdiv`/`srem`"
Summary: This reverts commit 2c16100e6f72075564ea1f67fa5a82c269dafcd3.
ninja check-polly fails: Polly :: Isl/CodeGen/MemAccess/generate-all.ll Polly :: ScopInfo/multidim_srem.ll
Reviewers: kadircet, bollu
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D83230
show more ...
|
#
2c16100e |
| 02-Jul-2020 |
Roman Lebedev <lebedev.ri@gmail.com> |
[ScalarEvolution] createSCEV(): recognize `udiv`/`urem` disguised as an `sdiv`/`srem`
Summary: While InstCombine trivially converts that `srem` into a `urem`, it might happen later than wanted, in p
[ScalarEvolution] createSCEV(): recognize `udiv`/`urem` disguised as an `sdiv`/`srem`
Summary: While InstCombine trivially converts that `srem` into a `urem`, it might happen later than wanted, in particular i'd like for that to happen on https://godbolt.org/z/bwuEmJ test case early in pipeline, before first instcombine run, just before `-mem2reg`.
SCEV should recognize this case natively.
Reviewers: mkazantsev, efriedma, nikic, reames
Reviewed By: efriedma
Subscribers: clementval, hiraditya, javed.absar, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D82721
show more ...
|
#
25521150 |
| 28-Jun-2020 |
Roman Lebedev <lebedev.ri@gmail.com> |
[NFC][ScalarEvolution] Add a test showing SCEV failure to recognize 'urem'
While InstCombine trivially converts that `srem` into a `urem`, it might happen later than wanted. SCEV should recognize th
[NFC][ScalarEvolution] Add a test showing SCEV failure to recognize 'urem'
While InstCombine trivially converts that `srem` into a `urem`, it might happen later than wanted. SCEV should recognize this natively.
show more ...
|