Revision tags: llvmorg-21-init, llvmorg-19.1.7 |
|
#
f82bb3d4 |
| 20-Dec-2024 |
Florian Hahn <flo@fhahn.com> |
[SCEV] Update changed test after df8efbdbb (take 2).
Test needed updating due to changes on main since branch was tested.
|
#
df8efbdb |
| 20-Dec-2024 |
Florian Hahn <flo@fhahn.com> |
[SCEV] Remove existing predicates implied by newly added ones. (#118185)
When adding a new predicate to a union predicate, some of the existing
predicates may be implied by the new predicate. Remov
[SCEV] Remove existing predicates implied by newly added ones. (#118185)
When adding a new predicate to a union predicate, some of the existing
predicates may be implied by the new predicate. Remove any existing
predicates that are already implied by the new predicate.
Depends on https://github.com/llvm/llvm-project/pull/118184 to show the
main benefit.
PR: https://github.com/llvm/llvm-project/pull/118185
show more ...
|
Revision tags: llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4 |
|
#
a353e258 |
| 05-Nov-2024 |
Florian Hahn <flo@fhahn.com> |
[LAA] Don't require Stride == 1/-1 for inbounds pointer AddRecs nowrap. (#113126)
If we have a pointer AddRec, the maximum increment is
2^(pointer-index-wdith - 1) - 1. This means that if increment
[LAA] Don't require Stride == 1/-1 for inbounds pointer AddRecs nowrap. (#113126)
If we have a pointer AddRec, the maximum increment is
2^(pointer-index-wdith - 1) - 1. This means that if incrementing the
AddRec wraps, the distance between the previously accessed location and
the wrapped location is > 2^(pointer-index-wdith - 1), i.e. if the GEP
for the AddRec is inbounds, this would be poison due to the object being
larger than half the pointer index type space. The poison would be
immediate UB when the memory access gets executed..
Similar reasoning can be applied for decrements.
PR: https://github.com/llvm/llvm-project/pull/113126
show more ...
|
Revision tags: 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 |
|
#
e7f4ad13 |
| 11-Apr-2023 |
Nikita Popov <npopov@redhat.com> |
[Transforms] Convert some tests to opaque pointers (NFC)
|
Revision tags: 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 |
|
#
9ed2f14c |
| 14-Dec-2022 |
Nikita Popov <npopov@redhat.com> |
[AsmParser] Remove typed pointer auto-detection
IR is now always parsed in opaque pointer mode, unless -opaque-pointers=0 is explicitly given. There is no automatic detection of typed pointers anymo
[AsmParser] Remove typed pointer auto-detection
IR is now always parsed in opaque pointer mode, unless -opaque-pointers=0 is explicitly given. There is no automatic detection of typed pointers anymore.
The -opaque-pointers=0 option is added to any remaining IR tests that haven't been migrated yet.
Differential Revision: https://reviews.llvm.org/D141912
show more ...
|
#
79a1a5b3 |
| 07-Dec-2022 |
Roman Lebedev <lebedev.ri@gmail.com> |
[NFC] Port all LoopVersioning tests to `-passes=` syntax
|
Revision tags: llvmorg-15.0.6, 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 |
|
#
7e680613 |
| 12-Jan-2022 |
Florian Hahn <flo@fhahn.com> |
[IRBuilder] Migrate add-folding to value-based FoldAdd.
Depends on D116935.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D116968
|
#
f0ef1ea6 |
| 11-Jan-2022 |
Florian Hahn <flo@fhahn.com> |
[IRBuilder] Introduce folder using inst-simplify, use for Or fold.
Alternative to D116817.
This introduces a new value-based folding interface for Or (FoldOr), which takes 2 values and returns an e
[IRBuilder] Introduce folder using inst-simplify, use for Or fold.
Alternative to D116817.
This introduces a new value-based folding interface for Or (FoldOr), which takes 2 values and returns an existing Value or a constant if the Or can be simplified. Otherwise nullptr is returned. This replaces the more restrictive CreateOr which takes 2 constants.
This is the used to implement a folder that uses InstructionSimplify. The logic to simplify `Or` instructions is moved there. Subsequent patches are going to transition other CreateXXX to the more general FoldXXX interface.
Reviewed By: nikic, lebedev.ri
Differential Revision: https://reviews.llvm.org/D116935
show more ...
|
#
aecad582 |
| 10-Jan-2022 |
Florian Hahn <flo@fhahn.com> |
[SCEVExpander] Only create trunc when needed.
9345ab3a4550 updated generateOverflowCheck to skip creating checks that always evaluate to false. This in turn means that we only need to create TruncTr
[SCEVExpander] Only create trunc when needed.
9345ab3a4550 updated generateOverflowCheck to skip creating checks that always evaluate to false. This in turn means that we only need to create TruncTripCount if it is actually used.
Sink the TruncTripCount creating into ComputeEndCheck, so it is only created when there's an actual check.
show more ...
|
#
ad1b8772 |
| 10-Jan-2022 |
Florian Hahn <flo@fhahn.com> |
[SCEVExpander] Only create multiplication if needed.
9345ab3a4550 updated generateOverflowCheck to skip creating checks that always evaluate to false. This in turn means that we only need to compute
[SCEVExpander] Only create multiplication if needed.
9345ab3a4550 updated generateOverflowCheck to skip creating checks that always evaluate to false. This in turn means that we only need to compute |Step| * Trip count if the result of the multiplication is actually used.
Sink the multiplication into ComputeEndCheck, so it is only created when there's an actual check.
show more ...
|
#
7f1bf68d |
| 06-Jan-2022 |
Florian Hahn <flo@fhahn.com> |
[SCEVExpander] Only check overflow if it is needed.
9345ab3a4550 updated generateOverflowCheck to skip creating checks that always evaluate to false. This in turn means that we only need to check fo
[SCEVExpander] Only check overflow if it is needed.
9345ab3a4550 updated generateOverflowCheck to skip creating checks that always evaluate to false. This in turn means that we only need to check for overflows if the result of the multiplication is actually used.
Sink the Or for the overflow check into ComputeEndCheck, so it is only created when there's an actual check.
show more ...
|
#
9345ab3a |
| 08-Jan-2022 |
Florian Hahn <flo@fhahn.com> |
[SCEVExpander] Skip creating <u 0 check, which is always false.
Unsigned compares of the form <u 0 are always false. Do not create such a redundant check in generateOverflowCheck.
The patch introdu
[SCEVExpander] Skip creating <u 0 check, which is always false.
Unsigned compares of the form <u 0 are always false. Do not create such a redundant check in generateOverflowCheck.
The patch introduces a new lambda to create the check, so we can exit early conveniently and skip creating some instructions feeding the check.
I am planning to sink a few additional instructions as follow-ups, but I would prefer to do this separately, to keep the changes and diff smaller.
Reviewed By: reames
Differential Revision: https://reviews.llvm.org/D116811
show more ...
|
#
f395a4f8 |
| 07-Jan-2022 |
Florian Hahn <flo@fhahn.com> |
[SCEVExpand] Only create required predicate checks.
Currently generateOverflowCheck always creates code for Step being negative and positive, followed by a select at the end depending on Step's sign
[SCEVExpand] Only create required predicate checks.
Currently generateOverflowCheck always creates code for Step being negative and positive, followed by a select at the end depending on Step's sign.
This patch updates the code to only create either the checks for step being positive or negative, if the sign is known.
Follow-up to D116696.
Reviewed By: reames
Differential Revision: https://reviews.llvm.org/D116747
show more ...
|
#
86d113a8 |
| 06-Jan-2022 |
Florian Hahn <flo@fhahn.com> |
[SCEVExpand] Do not create redundant 'or false' for pred expansion.
This patch updates SCEVExpander::expandUnionPredicate to not create redundant 'or false, x' instructions. While those are triviall
[SCEVExpand] Do not create redundant 'or false' for pred expansion.
This patch updates SCEVExpander::expandUnionPredicate to not create redundant 'or false, x' instructions. While those are trivially foldable, they can be easily avoided and hinder code that checks the size/cost of the generated checks before further folds.
I am planning on look into a few other similar improvements to code generated by SCEVExpander.
I remember a while ago @lebedev.ri working on doing some trivial folds like that in IRBuilder itself, but there where concerns that such changes may subtly break existing code.
Reviewed By: reames, lebedev.ri
Differential Revision: https://reviews.llvm.org/D116696
show more ...
|
Revision tags: llvmorg-13.0.1-rc1 |
|
#
b2915971 |
| 27-Oct-2021 |
Roman Lebedev <lebedev.ri@gmail.com> |
Revert rest of `IRBuilderBase`'s short-circuiting folds
Upon further investigation and discussion, this is actually the opposite direction from what we should be taking, and this direction wouldn't
Revert rest of `IRBuilderBase`'s short-circuiting folds
Upon further investigation and discussion, this is actually the opposite direction from what we should be taking, and this direction wouldn't solve the motivational problem anyway.
Additionally, some more (polly) tests have escaped being updated. So, let's just take a step back here.
This reverts commit f3190dedeef9da2109ea57e4cb372f295ff53b88. This reverts commit 749581d21f2b3f53e4fca4eb8728c942d646893b. This reverts commit f3df87d57e096143670e0fd396e81d43393a2dd2. This reverts commit ab1dbcecd6f0969976fafd62af34730436ad5944.
show more ...
|
#
101aaf62 |
| 27-Oct-2021 |
Roman Lebedev <lebedev.ri@gmail.com> |
Revert "[NFC] `IRBuilderBase::CreateAdd()`: place constant onto RHS"
Clang OpenMP codegen tests are failing, will recommit afterwards.
This reverts commit 4723c9b3c6c46632a5d66e65d198899894b1e2c5.
|
#
42712698 |
| 27-Oct-2021 |
Roman Lebedev <lebedev.ri@gmail.com> |
Revert "[IR] `IRBuilderBase::CreateAdd()`: short-circuit `x + 0` --> `x`"
Clang OpenMP codegen tests are failing.
This reverts commit 288f1f8abe5835180a0021f142043ee261ab3846. This reverts commit c
Revert "[IR] `IRBuilderBase::CreateAdd()`: short-circuit `x + 0` --> `x`"
Clang OpenMP codegen tests are failing.
This reverts commit 288f1f8abe5835180a0021f142043ee261ab3846. This reverts commit cb90e5356ac1594e95fed8e208d6e0e9b6a87db1.
show more ...
|
#
cb90e535 |
| 27-Oct-2021 |
Roman Lebedev <lebedev.ri@gmail.com> |
[IR] `IRBuilderBase::CreateAdd()`: short-circuit `x + 0` --> `x`
There's precedent for that in `CreateOr()`/`CreateAnd()`.
The motivation here is to avoid bloating the run-time check's IR in `SCEVE
[IR] `IRBuilderBase::CreateAdd()`: short-circuit `x + 0` --> `x`
There's precedent for that in `CreateOr()`/`CreateAnd()`.
The motivation here is to avoid bloating the run-time check's IR in `SCEVExpander::generateOverflowCheck()`.
Refs. https://reviews.llvm.org/D109368#3089809
show more ...
|
#
4723c9b3 |
| 27-Oct-2021 |
Roman Lebedev <lebedev.ri@gmail.com> |
[NFC] `IRBuilderBase::CreateAdd()`: place constant onto RHS
|
#
f3df87d5 |
| 27-Oct-2021 |
Roman Lebedev <lebedev.ri@gmail.com> |
[IR] `IRBuilderBase::CreateOr()`: fix short-circuiting for constant on LHS
There is no guarantee that the constant is on RHS here, we have to handle both cases.
Refs. https://reviews.llvm.org/D1093
[IR] `IRBuilderBase::CreateOr()`: fix short-circuiting for constant on LHS
There is no guarantee that the constant is on RHS here, we have to handle both cases.
Refs. https://reviews.llvm.org/D109368#3089809
show more ...
|
#
ab1dbcec |
| 27-Oct-2021 |
Roman Lebedev <lebedev.ri@gmail.com> |
[IR] `IRBuilderBase::CreateSelect()`: if cond is a constant i1, short-circuit
While we could emit such a tautological `select`, it will stick around until the next instsimplify invocation, which may
[IR] `IRBuilderBase::CreateSelect()`: if cond is a constant i1, short-circuit
While we could emit such a tautological `select`, it will stick around until the next instsimplify invocation, which may happen after we count the cost of this redundant `select`. Which is precisely what happens with loop vectorization legality checks, and that artificially increases the cost of said checks, which is bad.
There is prior art for this in `IRBuilderBase::CreateAnd()`/`IRBuilderBase::CreateOr()`.
Refs. https://reviews.llvm.org/D109368#3089809
show more ...
|
Revision tags: llvmorg-13.0.0, llvmorg-13.0.0-rc4, llvmorg-13.0.0-rc3 |
|
#
c86e1ce7 |
| 01-Sep-2021 |
Nikita Popov <nikita.ppv@gmail.com> |
[SCEVExpander] Simplify pointer overflow check
This is a followup to D104662 to generate slightly nicer code for pointer overflow checks. Bypass expandAddToGEP and instead explicitly generate i8 GEP
[SCEVExpander] Simplify pointer overflow check
This is a followup to D104662 to generate slightly nicer code for pointer overflow checks. Bypass expandAddToGEP and instead explicitly generate i8 GEPs. This saves some bitcasts and negates the value in a more obvious way. In particular, this prevents SCEV from looking through the umul.with.overflow, same as in the integer case.
The wrapping-pointer-ni.ll test deserves a comment: Previously, this generated a typed GEP which used the umulo argument rather than the multiplication result. This results in more compact IR in that case, but effectively does the multiplication twice, the second one is just hidden in the GEP. Reusing the umulo result seems pretty reasonable to me.
Differential Revision: https://reviews.llvm.org/D109093
show more ...
|
#
e735f2bf |
| 01-Sep-2021 |
Philip Reames <listmail@philipreames.com> |
[SCEVExpander] Prefer pointer expansion for overflow checks
We'd special cased this logic to use pointer types for non-integral pointers, but there's no reason we can't do that for all pointer types
[SCEVExpander] Prefer pointer expansion for overflow checks
We'd special cased this logic to use pointer types for non-integral pointers, but there's no reason we can't do that for all pointer types. Doing it this was has a few advantages: a) The code itself becomes more straight forward, and easier to test. b) We avoid introducing ptrtoint into programs which didn't have them in the source. c) The resulting codegen is easier to analyze and simplify (mostly due to lack of ptrtoint).
Note that there are some test diffs, but a) running them through instcombine helps a ton, and b) there's enough missing obvious transforms on both before and after IR that it's clear this isn't performance sensitive.
This is mostly motivated by cleaning up mentions of non-integrals to have a clearer idea of what we actually need to support.
Differential Revision: https://reviews.llvm.org/D104662
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 |
|
#
0c09e5bd |
| 21-Jun-2021 |
Philip Reames <listmail@philipreames.com> |
Split a test for ease of auto update
|