|
Revision tags: llvmorg-21-init, llvmorg-19.1.7, llvmorg-19.1.6, llvmorg-19.1.5 |
|
| #
56c091ea |
| 21-Nov-2024 |
Paul Walker <paul.walker@arm.com> |
[LLVM][IR] Use splat syntax when printing ConstantExpr based splats. (#116856)
This brings the printing of scalable vector constant splats inline with
their fixed length counterparts.
|
|
Revision tags: llvmorg-19.1.4 |
|
| #
38fffa63 |
| 06-Nov-2024 |
Paul Walker <paul.walker@arm.com> |
[LLVM][IR] Use splat syntax when printing Constant[Data]Vector. (#112548)
|
|
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 |
|
| #
1baa3850 |
| 18-Apr-2024 |
Nikita Popov <npopov@redhat.com> |
[IR][PatternMatch] Only accept poison in getSplatValue() (#89159)
In #88217 a large set of matchers was changed to only accept poison
values in splats, but not undef values. This is because we now
[IR][PatternMatch] Only accept poison in getSplatValue() (#89159)
In #88217 a large set of matchers was changed to only accept poison
values in splats, but not undef values. This is because we now use
poison for non-demanded vector elements, and allowing undef can cause
correctness issues.
This patch covers the remaining matchers by changing the AllowUndef
parameter of getSplatValue() to AllowPoison instead. We also carry out
corresponding renames in matchers.
As a followup, we may want to change the default for things like m_APInt
to m_APIntAllowPoison (as this is much less risky when only allowing
poison), but this change doesn't do that.
There is one caveat here: We have a single place
(X86FixupVectorConstants) which does require handling of vector splats
with undefs. This is because this works on backend constant pool
entries, which currently still use undef instead of poison for
non-demanded elements (because SDAG as a whole does not have an explicit
poison representation). As it's just the single use, I've open-coded a
getSplatValueAllowUndef() helper there, to discourage use in any other
places.
show more ...
|
|
Revision tags: 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 |
|
| #
fd07b8f8 |
| 15-Feb-2024 |
Paul Walker <paul.walker@arm.com> |
[LLVM][tests/Transforms/InstCombine] Convert instances of ConstantExpr based splats to use splat().
This is mostly NFC but some output does change due to consistently inserting into poison rather th
[LLVM][tests/Transforms/InstCombine] Convert instances of ConstantExpr based splats to use splat().
This is mostly NFC but some output does change due to consistently inserting into poison rather than undef and using i64 as the index type for inserts.
show more ...
|
|
Revision tags: llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init |
|
| #
a5f34155 |
| 18-Dec-2023 |
Nikita Popov <npopov@redhat.com> |
[InstCombine] Replace non-demanded undef vector with poison
If an operand (esp to shufflevector or insertelement) is not demanded, canonicalize it from undef to poison.
|
| #
d0605e21 |
| 18-Dec-2023 |
Nikita Popov <npopov@redhat.com> |
[InstCombine] Canonicalize splat shuffles to use poison operand
If the splat shuffle is represented using an undef RHS, replace it with poison.
|
|
Revision tags: llvmorg-17.0.6, llvmorg-17.0.5 |
|
| #
c2a19666 |
| 10-Nov-2023 |
Nikita Popov <npopov@redhat.com> |
[InstCombine] Remove bitcast handling from SimplifyDemandedBits
The complex set of type checks in this code reduces down to "always return nullptr". Drop the code to use the default implementation i
[InstCombine] Remove bitcast handling from SimplifyDemandedBits
The complex set of type checks in this code reduces down to "always return nullptr". Drop the code to use the default implementation instead, which will just compute the KnownBits for the bitcast.
show more ...
|
|
Revision tags: 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, working, llvmorg-15.0.2 |
|
| #
4ab40eca |
| 03-Oct-2022 |
Bjorn Pettersson <bjorn.a.pettersson@ericsson.com> |
[test][InstCombine] Update some test cases to use opaque pointers
These tests cases were converted using the script at https://gist.github.com/nikic/98357b71fd67756b0f064c9517b62a34
Differential Re
[test][InstCombine] Update some test cases to use opaque pointers
These tests cases were converted using the script at https://gist.github.com/nikic/98357b71fd67756b0f064c9517b62a34
Differential Revision: https://reviews.llvm.org/D135094
show more ...
|
|
Revision tags: 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 |
|
| #
acdc419c |
| 04-Feb-2022 |
Bjorn Pettersson <bjorn.a.pettersson@ericsson.com> |
[test] Use -passes=instcombine instead of -instcombine in lots of tests. NFC
Another step moving away from the deprecated syntax of specifying pass pipeline in opt.
Differential Revision: https://r
[test] Use -passes=instcombine instead of -instcombine in lots of tests. NFC
Another step moving away from the deprecated syntax of specifying pass pipeline in opt.
Differential Revision: https://reviews.llvm.org/D119081
show more ...
|
|
Revision tags: llvmorg-15-init |
|
| #
70b3beb0 |
| 31-Jan-2022 |
Max Kazantsev <mkazantsev@azul.com> |
[InstCombine] Generalize and-reduce pattern to handle `ne` case as well as `eq`
Following Sanjay's proposal from discussion in D118317, this patch generalizes and-reduce handling to fold the followi
[InstCombine] Generalize and-reduce pattern to handle `ne` case as well as `eq`
Following Sanjay's proposal from discussion in D118317, this patch generalizes and-reduce handling to fold the following pattern ``` icmp ne (bitcast(icmp ne (lhs, rhs)), 0) ``` into ``` icmp ne (bitcast(lhs), bitcast(rhs)) ```
https://alive2.llvm.org/ce/z/WDcuJ_
Differential Revision: https://reviews.llvm.org/D118431 Reviewed By: lebedev.ri
show more ...
|
| #
3b194ca7 |
| 29-Jan-2022 |
Max Kazantsev <mkazantsev@azul.com> |
Recommit "[InstCombine] Fold and-reduce idiom"
Checks of original vector types made more thorough.
Differential Revision: https://reviews.llvm.org/D118317
|
| #
521205c0 |
| 29-Jan-2022 |
Max Kazantsev <mkazantsev@azul.com> |
[Test] Add pointer comparison test that crashed with D118317
|
| #
fabaca10 |
| 28-Jan-2022 |
Hans Wennborg <hans@chromium.org> |
Revert "[InstCombine] Fold and-reduce idiom"
It causes builds to fail with
llvm/include/llvm/Support/Casting.h:269: typename llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X = llvm::Integer
Revert "[InstCombine] Fold and-reduce idiom"
It causes builds to fail with
llvm/include/llvm/Support/Casting.h:269: typename llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X = llvm::IntegerType; Y = const llvm::Type; typename llvm::cast_retty<X, Y*>::ret_type = const llvm::IntegerType*]: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
See the code review for link to a reproducer.
> This patch introduces folding of and-reduce idiom and generates code > that is easier to read and which is lest costly in terms of icmp operations. > The folding is > ``` > icmp eq (bitcast(icmp ne (lhs, rhs)), 0) > ``` > into > ``` > icmp eq(bitcast(lhs), bitcast(rhs)) > ``` > > See PR53419. > > Differential Revision: https://reviews.llvm.org/D118317 > Reviewed By: lebedev.ri, spatel
This reverts commit 8599bb0f26738ed88aae62aba57d82f7cf326cf9.
This also revertes the dependent change:
"[Test] Add 'ne' tests for and-reduce pattern folding"
This reverts commit a4aaa5995308ac2ba1bf180c9ce9c321cdb9f28a.
show more ...
|
| #
b3d2a96d |
| 28-Jan-2022 |
Max Kazantsev <mkazantsev@azul.com> |
[Test] One more test for 'ne' and-reduce pattern
|
| #
8599bb0f |
| 28-Jan-2022 |
Max Kazantsev <mkazantsev@azul.com> |
[InstCombine] Fold and-reduce idiom
This patch introduces folding of and-reduce idiom and generates code that is easier to read and which is lest costly in terms of icmp operations. The folding is `
[InstCombine] Fold and-reduce idiom
This patch introduces folding of and-reduce idiom and generates code that is easier to read and which is lest costly in terms of icmp operations. The folding is ``` icmp eq (bitcast(icmp ne (lhs, rhs)), 0) ``` into ``` icmp eq(bitcast(lhs), bitcast(rhs)) ```
See PR53419.
Differential Revision: https://reviews.llvm.org/D118317 Reviewed By: lebedev.ri, spatel
show more ...
|
| #
e74d1460 |
| 27-Jan-2022 |
Max Kazantsev <mkazantsev@azul.com> |
[Test] Add data layout to relevant tests + some wide-typed tests
|
|
Revision tags: llvmorg-13.0.1, llvmorg-13.0.1-rc3, llvmorg-13.0.1-rc2, llvmorg-13.0.1-rc1, llvmorg-13.0.0, llvmorg-13.0.0-rc4 |
|
| #
ec831144 |
| 22-Sep-2021 |
hyeongyu kim <gusrb406@snu.ac.kr> |
[InstCombine] Update InstCombine to use poison instead of undef for shufflevector's placeholder (2/3)
This patch is for fixing potential shufflevector-related bugs like D93818. As D93818, this patch
[InstCombine] Update InstCombine to use poison instead of undef for shufflevector's placeholder (2/3)
This patch is for fixing potential shufflevector-related bugs like D93818. As D93818, this patch change shufflevector's default placeholder to poison. To reduce risk, it was divided into several patches, and this patch is for InstCombineCompares and InstructionCombining.
Reviewed By: spatel
Differential Revision: https://reviews.llvm.org/D110227
show more ...
|
|
Revision tags: llvmorg-13.0.0-rc3, llvmorg-13.0.0-rc2 |
|
| #
0369714b |
| 06-Aug-2021 |
Sanjay Patel <spatel@rotateright.com> |
[InstCombine] reduce vector casting before icmp
There may be some generalizations (see test comments) of these patterns, but this should handle the cases motivated by: https://llvm.org/PR51315 https
[InstCombine] reduce vector casting before icmp
There may be some generalizations (see test comments) of these patterns, but this should handle the cases motivated by: https://llvm.org/PR51315 https://llvm.org/PR51259
The backend may want to transform differently, but at least for the x86 examples that I looked at, there does not appear to be any significant perf diff either way.
show more ...
|
| #
67d49944 |
| 06-Aug-2021 |
Sanjay Patel <spatel@rotateright.com> |
[InstCombine] add tests for icmp of casted vector; NFC
https://llvm.org/PR51315
|
|
Revision tags: llvmorg-13.0.0-rc1 |
|
| #
bdd55b2f |
| 31-Jul-2021 |
Eli Friedman <efriedma@quicinc.com> |
Fix the default alignment of i1 vectors.
Currently, the default alignment is much larger than the actual size of the vector in memory. Fix this to use a sane default.
For SVE, temporarily remove l
Fix the default alignment of i1 vectors.
Currently, the default alignment is much larger than the actual size of the vector in memory. Fix this to use a sane default.
For SVE, temporarily remove lowering of load/store operations for predicates with less than 16 elements. The layout the backend was assuming for SVE predicates with less than 16 elements doesn't agree with the frontend. More work probably needs to be done here.
This change is, strictly speaking, not backwards-compatible at the bitcode level. But probably nobody is actually depending on that; i1 vectors in memory are rare, and the code that does use them probably ends up forcing the alignment to something sane anyway. If we think this is a concern, I can restrict this to scalable vectors for now (where it's actually causing issues for me at the moment).
Differential Revision: https://reviews.llvm.org/D88994
show more ...
|
| #
a22c99c3 |
| 31-Jul-2021 |
Sanjay Patel <spatel@rotateright.com> |
[InstCombine] canonicalize cmp-of-bitcast-of-vector-cmp to use zero constant
We can invert a compare constant and preserve the logic as shown in this sampling: https://alive2.llvm.org/ce/z/YAXbfs (I
[InstCombine] canonicalize cmp-of-bitcast-of-vector-cmp to use zero constant
We can invert a compare constant and preserve the logic as shown in this sampling: https://alive2.llvm.org/ce/z/YAXbfs (In theory, we could deal with non-all-ones/zero as well, but it doesn't seem worthwhile.)
I noticed this as a part of the x86 codegen difference in https://llvm.org/PR51259 - it ends up using "test" instead of "not + cmp" in that example.
This pattern also shows up in https://llvm.org/PR41312 and https://llvm.org/PR50798 .
Differential Revision: https://reviews.llvm.org/D107170
show more ...
|
| #
e5d9831c |
| 30-Jul-2021 |
Sanjay Patel <spatel@rotateright.com> |
[InstCombine] add more tests for vector cmp-bitcast; NFC
D107170
|
| #
c6d147b0 |
| 30-Jul-2021 |
Sanjay Patel <spatel@rotateright.com> |
[InstCombine] add more tests for vector-cmp bitcast; NFC
|
| #
f3c39ee8 |
| 29-Jul-2021 |
Sanjay Patel <spatel@rotateright.com> |
[InstCombine] add tests for vector cmp-bitcast; NFC
|
|
Revision tags: llvmorg-14-init, llvmorg-12.0.1, llvmorg-12.0.1-rc4, llvmorg-12.0.1-rc3, llvmorg-12.0.1-rc2 |
|
| #
fd3b5569 |
| 31-May-2021 |
Fraser Cormack <fraser@codeplay.com> |
[Constants] Extend support for scalable-vector splats
This patch extends the various "isXXX" functions of the `Constant` class to include scalable-vector splats.
In several "isXXX" functions, code
[Constants] Extend support for scalable-vector splats
This patch extends the various "isXXX" functions of the `Constant` class to include scalable-vector splats.
In several "isXXX" functions, code that was separately inspecting `ConstantVector` and `ConstantDataVector` was unified to use `getSplatValue`, which already includes support for said splats.
In the varous "isNotXXX" functions, code was added to check whether the scalar splat value -- if any -- satisfies the predicate.
An extra fix for `isNotMinSignedValue` was included, as it previously crashed when passed a scalable-vector type because it unconditionally cast to `FixedVectorType`
These changes address numerous missed optimizations, a compiler crash mentioned above and -- perhaps most egregiously -- an infinite loop in InstCombine due to the compiler breaking canonical form when it failed to pick up on a splat in a select instruction.
Test cases have been added to cover as many of these functions as possible, though existing coverage is slim; it doesn't appear that there are any in-tree uses of `Constant::isNegativeZeroValue`, for example.
Reviewed By: RKSimon
Differential Revision: https://reviews.llvm.org/D103421
show more ...
|