|
Revision tags: llvmorg-21-init, llvmorg-19.1.7, llvmorg-19.1.6, llvmorg-19.1.5, 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 |
|
| #
a1058776 |
| 21-Aug-2024 |
Nikita Popov <npopov@redhat.com> |
[InstCombine] Remove some of the complexity-based canonicalization (#91185)
The idea behind this canonicalization is that it allows us to handle less
patterns, because we know that some will be can
[InstCombine] Remove some of the complexity-based canonicalization (#91185)
The idea behind this canonicalization is that it allows us to handle less
patterns, because we know that some will be canonicalized away. This is
indeed very useful to e.g. know that constants are always on the right.
However, this is only useful if the canonicalization is actually
reliable. This is the case for constants, but not for arguments: Moving
these to the right makes it look like the "more complex" expression is
guaranteed to be on the left, but this is not actually the case in
practice. It fails as soon as you replace the argument with another
instruction.
The end result is that it looks like things correctly work in tests,
while they actually don't. We use the "thwart complexity-based
canonicalization" trick to handle this in tests, but it's often a
challenge for new contributors to get this right, and based on the
regressions this PR originally exposed, we clearly don't get this right
in many cases.
For this reason, I think that it's better to remove this complexity
canonicalization. It will make it much easier to write tests for
commuted cases and make sure that they are handled.
show more ...
|
|
Revision tags: 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 |
|
| #
534701d5 |
| 09-May-2024 |
Nikita Popov <npopov@redhat.com> |
[InstCombine] Handle commuted variants in or of xor pattern
This pattern only handled commutation in the "or", while all involved operations are commutative. Make sure we handle all sixteen patterns.
|
| #
90ffaa6c |
| 09-May-2024 |
Nikita Popov <npopov@redhat.com> |
[InstCombine] Add proper test coverage for or of xors pattern (NFC)
Test all commuted variants of the pattern, most of which currently fail to fold.
|
|
Revision tags: 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 |
|
| #
65bf93dd |
| 07-Feb-2024 |
Yingwei Zheng <dtcxzyw2333@gmail.com> |
[InstCombine] Clean up bitwise folds without one-use check (#80587)
This patch removes some bitwise folds that fail to check the one-use
constraint on the operands.
See also the comments
https://
[InstCombine] Clean up bitwise folds without one-use check (#80587)
This patch removes some bitwise folds that fail to check the one-use
constraint on the operands.
See also the comments
https://github.com/llvm/llvm-project/pull/77231#issuecomment-1904090035.
show more ...
|
|
Revision tags: llvmorg-18.1.0-rc2 |
|
| #
f2816ff6 |
| 31-Jan-2024 |
Yingwei Zheng <dtcxzyw2333@gmail.com> |
[InstCombine] Simplify and/or by replacing operands with constants (#77231)
This patch tries to simplify `X | Y` by replacing occurrences of `Y` in
`X` with 0. Similarly, it tries to simplify `X &
[InstCombine] Simplify and/or by replacing operands with constants (#77231)
This patch tries to simplify `X | Y` by replacing occurrences of `Y` in
`X` with 0. Similarly, it tries to simplify `X & Y` by replacing
occurrences of `Y` in `X` with -1.
Alive2: https://alive2.llvm.org/ce/z/cNjDTR
Note: As the current implementation is too conservative in the one-use
checks, I cannot remove other existing hard-coded simplifications if
they involves more than two instructions (e.g, `A & ~(A ^ B) --> A &
B`).
Compile-time impact:
http://llvm-compile-time-tracker.com/compare.php?from=a085402ef54379758e6c996dbaedfcb92ad222b5&to=9d655c6685865ffce0ad336fed81228f3071bd03&stat=instructions%3Au
|stage1-O3|stage1-ReleaseThinLTO|stage1-ReleaseLTO-g|stage1-O0-g|stage2-O3|stage2-O0-g|stage2-clang|
|--|--|--|--|--|--|--|
|+0.01%|-0.00%|+0.00%|-0.02%|+0.01%|+0.02%|-0.01%|
Fixes #76554.
show more ...
|
|
Revision tags: llvmorg-18.1.0-rc1, llvmorg-19-init |
|
| #
4444a7e8 |
| 03-Jan-2024 |
ChipsSpectre <maxi.hornung@t-online.de> |
[InstSimplify] Simplify the expression `(a^c)&(a^~c)` to zero and (a^c) | (a^~c) to minus one (#76637)
Changes the InstSimplify pass of the LLVM optimizer, such that the
aforementioned expression i
[InstSimplify] Simplify the expression `(a^c)&(a^~c)` to zero and (a^c) | (a^~c) to minus one (#76637)
Changes the InstSimplify pass of the LLVM optimizer, such that the
aforementioned expression is reduced to zero if c2==~c1.
Alive2: https://alive2.llvm.org/ce/z/xkQiid
Fixes https://github.com/llvm/llvm-project/issues/75692.
show more ...
|
|
Revision tags: 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, 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 |
|
| #
5c759edc |
| 03-Sep-2022 |
Sanjay Patel <spatel@rotateright.com> |
[InstCombine] reduce another or-xor bitwise logic pattern
~(A & ?) | (A ^ B) --> ~((A & ?) & B) https://alive2.llvm.org/ce/z/mxex6V
This is similar to 9d218b61cc50 where we peeked through another l
[InstCombine] reduce another or-xor bitwise logic pattern
~(A & ?) | (A ^ B) --> ~((A & ?) & B) https://alive2.llvm.org/ce/z/mxex6V
This is similar to 9d218b61cc50 where we peeked through another logic op to find a common operand.
show more ...
|
| #
fbfac8e3 |
| 02-Sep-2022 |
Sanjay Patel <spatel@rotateright.com> |
[InstCombine] add tests for or-xor-nand; NFC
|
|
Revision tags: llvmorg-15.0.0-rc3 |
|
| #
b066195b |
| 18-Aug-2022 |
Sanjay Patel <spatel@rotateright.com> |
[InstCombine] fold bitwise logic or+or+xor+not
(~A | C) | (A ^ B) --> ~(A & B) | C https://alive2.llvm.org/ce/z/Qw3aiJ
This extends the existing fold (just above the new match) to peek through anot
[InstCombine] fold bitwise logic or+or+xor+not
(~A | C) | (A ^ B) --> ~(A & B) | C https://alive2.llvm.org/ce/z/Qw3aiJ
This extends the existing fold (just above the new match) to peek through another 'or' instruction.
This should let the motivating case from issue #57174 simplify completely.
show more ...
|
| #
0e9fada7 |
| 18-Aug-2022 |
Sanjay Patel <spatel@rotateright.com> |
[InstCombine] add tests for or-xor-not patterns; NFC
|
| #
8b56fa92 |
| 13-Aug-2022 |
Sanjay Patel <spatel@rotateright.com> |
[InstCombine] fix "X|(X^Y)" pattern-matching for commuted variants
|
| #
34ef8c31 |
| 13-Aug-2022 |
Sanjay Patel <spatel@rotateright.com> |
[InstCombine] add tests for or-xor; NFC
The existing pattern matching fails to handle all commutes.
|
| #
9d218b61 |
| 13-Aug-2022 |
Sanjay Patel <spatel@rotateright.com> |
[InstCombine] reduce or-xor-or patterns
(A | ?) | (A ^ B) --> (A | ?) | B https://alive2.llvm.org/ce/z/dbNQw4
This extends the existing transform to peek through another 'or' instruction for the co
[InstCombine] reduce or-xor-or patterns
(A | ?) | (A ^ B) --> (A | ?) | B https://alive2.llvm.org/ce/z/dbNQw4
This extends the existing transform to peek through another 'or' instruction for the common operand.
This is the underlying missing fold that should allow issue #56711 and issue #57120 to reduce even more.
show more ...
|
| #
f7e98ef6 |
| 12-Aug-2022 |
Sanjay Patel <spatel@rotateright.com> |
[InstCombine] add tests for or-xor-or; NFC
|
|
Revision tags: 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 |
|
| #
308ca349 |
| 02-Apr-2022 |
Roman Lebedev <lebedev.ri@gmail.com> |
[InstCombine] Fold `(X | C2) ^ C1 --> (X & ~C2) ^ (C1^C2)`
These two are equivalent, and i *think* the `and` form is more-ish canonical.
General proof: https://alive2.llvm.org/ce/z/RrF5s6
If const
[InstCombine] Fold `(X | C2) ^ C1 --> (X & ~C2) ^ (C1^C2)`
These two are equivalent, and i *think* the `and` form is more-ish canonical.
General proof: https://alive2.llvm.org/ce/z/RrF5s6
If constant on the (outer) `xor` is an `undef`, the whole lane is dead: https://alive2.llvm.org/ce/z/mu4Sh2
However, if the constant on the (inner) `or` is an `undef`, we must sanitize it first: https://alive2.llvm.org/ce/z/MHYJL7 I guess, producing a zero `and`-mask is optimal in that case.
alive-tv is happy about the entirety of `xor-of-or.ll`.
show more ...
|
|
Revision tags: 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, llvmorg-13.0.1, llvmorg-13.0.1-rc3, llvmorg-13.0.1-rc2, llvmorg-13.0.1-rc1 |
|
| #
7daa95c8 |
| 15-Nov-2021 |
Mehrnoosh Heidarpour <mehrnoosh.heidarpour@huawei.com> |
[InstCombine] Fold (A^B)|~A-->~(A&B)
https://alive2.llvm.org/ce/z/2v6rhF
Fixes: https://llvm.org/PR52478
Differential Revision: https://reviews.llvm.org/D113783
|
| #
b69dc2d1 |
| 14-Nov-2021 |
Mehrnoosh Heidarpour <mehrnoosh.heidarpour@huawei.com> |
[InstCombine] add tests for or-xor logic fold; NFC
Baseline tests for D113783
Differential Revision: https://reviews.llvm.org/D113846
|
| #
d0e9879d |
| 29-Oct-2021 |
Sanjay Patel <spatel@rotateright.com> |
[InstCombine] allow vector splat matching for bitwise logic folds
These transforms are also likely missing a one-use check, but that's another patch.
|
| #
ae898411 |
| 29-Oct-2021 |
Sanjay Patel <spatel@rotateright.com> |
[InstCombine] add tests for bitwise logic folds; NFC
|
|
Revision tags: llvmorg-13.0.0, llvmorg-13.0.0-rc4, llvmorg-13.0.0-rc3, 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 |
|
| #
19084887 |
| 22-Feb-2021 |
Simon Pilgrim <llvm-dev@redking.me.uk> |
[InstCombine] Add PR45977 test coverage
|
|
Revision tags: 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 |
|
| #
d9ebaeeb |
| 24-Dec-2020 |
Roman Lebedev <lebedev.ri@gmail.com> |
[InstCombine] Hoist xor-by-constant from xor-by-value
This is one of the deficiencies that can be observed in https://godbolt.org/z/YPczsG after D91038 patch set.
This exposed two missing folds, on
[InstCombine] Hoist xor-by-constant from xor-by-value
This is one of the deficiencies that can be observed in https://godbolt.org/z/YPczsG after D91038 patch set.
This exposed two missing folds, one was fixed by the previous commit, another one is `(A ^ B) | ~(A ^ B) --> -1` / `(A ^ B) & ~(A ^ B) --> 0`.
`-early-cse` will catch it: https://godbolt.org/z/4n1T1v, but isn't meaningful to fix it in InstCombine, because we'd need to essentially do our own CSE, and we can't even rely on `Instruction::isIdenticalTo()`, because there are no guarantees that the order of operands matches. So let's just accept it as a loss.
show more ...
|
|
Revision tags: llvmorg-11.0.1, llvmorg-11.0.1-rc2, llvmorg-11.0.1-rc1, 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 |
|
| #
23bd33c6 |
| 12-Aug-2020 |
Sanjay Patel <spatel@rotateright.com> |
[InstCombine] prefer xor with -1 because 'not' is easier to understand (PR32706)
This is a retry of rL300977 which was reverted because of infinite loops. We have fixed all of the known places where
[InstCombine] prefer xor with -1 because 'not' is easier to understand (PR32706)
This is a retry of rL300977 which was reverted because of infinite loops. We have fixed all of the known places where that would happen, but there's still a chance that this patch will cause infinite loops.
This matches the demanded bits behavior in the DAG and should fix: https://bugs.llvm.org/show_bug.cgi?id=32706
Differential Revision: https://reviews.llvm.org/D32255
show more ...
|