|
Revision tags: llvmorg-21-init, llvmorg-19.1.7, llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3 |
|
| #
095d49da |
| 17-Oct-2024 |
Yingwei Zheng <dtcxzyw2333@gmail.com> |
[InstCombine] Set `samesign` when converting signed predicates into unsigned (#112642)
Alive2: https://alive2.llvm.org/ce/z/6cqdt-
|
|
Revision tags: 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 |
|
| #
bda8d1ad |
| 03-Jun-2024 |
Nikita Popov <npopov@redhat.com> |
[PatternMatch] Do not match constant expression trunc
Similar to the change previously made for binops, make m_Trunc() only match instructions, not constant expressions. This is more likely to cause
[PatternMatch] Do not match constant expression trunc
Similar to the change previously made for binops, make m_Trunc() only match instructions, not constant expressions. This is more likely to cause a crash than do something useful.
Fixes crash reported at: https://github.com/llvm/llvm-project/pull/92885#issuecomment-2145034670
show more ...
|
|
Revision tags: llvmorg-18.1.6 |
|
| #
d3dad7a7 |
| 06-May-2024 |
Yingwei Zheng <dtcxzyw2333@gmail.com> |
[InstCombine] Fix miscompilation caused by #90436 (#91133)
Proof: https://alive2.llvm.org/ce/z/iRnJ4i
Fixes https://github.com/llvm/llvm-project/issues/91127.
|
| #
b0eeacb2 |
| 03-May-2024 |
Nikita Popov <npopov@redhat.com> |
[InstCombine] Fold icmp of trunc nuw/nsw (#90436)
Convert the existing foldICmpTruncWithTruncOrExt() fold to work with
trunc nowrap flags instead of computeKnownBits(). This also allows us to
gene
[InstCombine] Fold icmp of trunc nuw/nsw (#90436)
Convert the existing foldICmpTruncWithTruncOrExt() fold to work with
trunc nowrap flags instead of computeKnownBits(). This also allows us to
generalize the fold to work with signed comparisons.
Interestingly, apart from the obvious combinations like signed
predicates with trunc nsw, some non-obvious ones are also legal. For
example for unsigned predicates we can do the transform for two trunc
nsw as well (rather than only trunc nuw).
Proofs: https://alive2.llvm.org/ce/z/ndewwK
show more ...
|
|
Revision tags: llvmorg-18.1.5 |
|
| #
e1622e18 |
| 29-Apr-2024 |
Nikita Popov <npopov@redhat.com> |
[InstCombine] Add tests for trunc nuw/nsw in icmp (NFC)
|
|
Revision tags: llvmorg-18.1.4 |
|
| #
b1094776 |
| 11-Apr-2024 |
Yingwei Zheng <dtcxzyw2333@gmail.com> |
[InstCombine] Infer nsw/nuw for trunc (#87910)
This patch adds support for inferring trunc's nsw/nuw flags.
|
|
Revision tags: 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 |
|
| #
99387e33 |
| 22-Oct-2023 |
Noah Goldstein <goldstein.w.n@gmail.com> |
[InstCombine] Add transforms for `(icmp uPred (trunc x),(truncOrZext(y)))`->`(icmp uPred x,y)`
Three transforms (all commutative): https://alive2.llvm.org/ce/z/Bc-nh4
Closes #71309
|
| #
0f3a9efc |
| 22-Oct-2023 |
Noah Goldstein <goldstein.w.n@gmail.com> |
[InstCombine] Add tests for transforming `(icmp eq/ne trunc(x), truncOrZext(y))`; NFC
|