History log of /llvm-project/llvm/test/Transforms/InstCombine/icmp-range.ll (Results 1 – 25 of 33)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
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
# 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, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2
# a3b52509 12-Mar-2024 Andreas Jonson <andjo403@hotmail.com>

[InstSimpliy] Use range attribute to simplify comparisons (#84627)

Use the new range attribute from https://github.com/llvm/llvm-project/pull/84617
to simplify comparisons where both sides have ran

[InstSimpliy] Use range attribute to simplify comparisons (#84627)

Use the new range attribute from https://github.com/llvm/llvm-project/pull/84617
to simplify comparisons where both sides have range information.

show more ...


# 54bb4be0 10-Mar-2024 Andreas Jonson <andjo403@hotmail.com>

[InstSimplify] Handle vec values when simplifying comparisons using range metadata (#84673)

Found that this failed with an assertion when vec was used in this
optimization while working on https://

[InstSimplify] Handle vec values when simplifying comparisons using range metadata (#84673)

Found that this failed with an assertion when vec was used in this
optimization while working on https://github.com/llvm/llvm-project/pull/84627.

show more ...


Revision tags: 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
# b3b3336e 06-Oct-2023 Yingwei Zheng <dtcxzyw2333@gmail.com>

[InstCombine] Simplify the pattern `a ne/eq (zext/sext (a ne/eq c))` (#65852)

This patch folds the pattern `a ne/eq (zext/sext (a ne/eq c))` into a boolean constant or a compare.
Clang vs GCC: http

[InstCombine] Simplify the pattern `a ne/eq (zext/sext (a ne/eq c))` (#65852)

This patch folds the pattern `a ne/eq (zext/sext (a ne/eq c))` into a boolean constant or a compare.
Clang vs GCC: https://godbolt.org/z/4ro817WE8
Proof for `zext`: https://alive2.llvm.org/ce/z/6z9NRF
Proof for `sext`: https://alive2.llvm.org/ce/z/tv5wuE
Fixes #65073.

show more ...


Revision tags: llvmorg-17.0.2
# 92a394e4 25-Sep-2023 Yingwei Zheng <dtcxzyw2333@gmail.com>

[InstCombine] Add pre-commit tests for PR59555. NFC.


Revision tags: llvmorg-17.0.1
# c2e248cc 18-Sep-2023 Yingwei Zheng <dtcxzyw2333@gmail.com>

[InstCombine] Fix typo in the test `icmp-range.ll`. NFC.


# d10ee894 18-Sep-2023 Yingwei Zheng <dtcxzyw2333@gmail.com>

[InstCombine] Add `sext` version of pre-commit tests for PR65852. NFC.


# dc118147 18-Sep-2023 Yingwei Zheng <dtcxzyw2333@gmail.com>

[InstCombine] Add pre-commit tests for PR65073. NFC.


Revision tags: 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
# 61d2f3a7 15-Mar-2023 Nikita Popov <npopov@redhat.com>

[InstCombine] Canonicalize icmp eq pow2 more thoroughly

We currently already canonicalize icmp eq (%x & Pow2), Pow2 to
icmp ne (%x & Pow2), 0. This patch generalizes the fold based on
known bits.

I

[InstCombine] Canonicalize icmp eq pow2 more thoroughly

We currently already canonicalize icmp eq (%x & Pow2), Pow2 to
icmp ne (%x & Pow2), 0. This patch generalizes the fold based on
known bits.

In particular, this allows us to handle comparisons against
!range !{i64 0, i64 2} loads, which addresses an optimization
regression in Rust caused by 8df376db7282b955e7990cb8887ee9dcd3565040.

Differential Revision: https://reviews.llvm.org/D146149

show more ...


# 9043cb75 15-Mar-2023 Nikita Popov <npopov@redhat.com>

[InstCombine] Add additional test for icmp eq/ne with bool load (NFC)


# d99d765f 15-Mar-2023 chenglin.bi <chenglin.bi@linaro.org>

[InstCombine] Remove one-use limit when it can simplify to a const in the pattern foldICmpUsingBoolRange

This patch follow up dd31a3b3a5, when the pattern return a constant we needn't limit it to on

[InstCombine] Remove one-use limit when it can simplify to a const in the pattern foldICmpUsingBoolRange

This patch follow up dd31a3b3a5, when the pattern return a constant we needn't limit it to one-use.

show more ...


# 06afee24 15-Mar-2023 chenglin.bi <chenglin.bi@linaro.org>

[InstCombine] Precommit tests for one-use check in icmp-range; NFC


Revision tags: llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3
# dd31a3b3 15-Feb-2023 chenglin.bi <chenglin.bi@linaro.org>

[InstCombine] fold icmp of the sum of ext bool based on limited range

For the pattern `(zext i1 X) + (sext i1 Y)`, the constant range is [-1, 1].
We can simplify the pattern by logical operations. L

[InstCombine] fold icmp of the sum of ext bool based on limited range

For the pattern `(zext i1 X) + (sext i1 Y)`, the constant range is [-1, 1].
We can simplify the pattern by logical operations. Like:

```
(zext i1 X) + (sext i1 Y) == -1 --> ~X & Y
(zext i1 X) + (sext i1 Y) == 0 --> ~(X ^ Y)
(zext i1 X) + (sext i1 Y) == 1 --> X & ~Y
```
And other predicates can the combination of these results:

```
(zext i1 X) + (sext i1 Y)) != -1 --> X | ~Y
(zext i1 X) + (sext i1 Y)) s> -1 --> X | ~Y
(zext i1 X) + (sext i1 Y)) u< -1 --> X | ~Y
(zext i1 X) + (sext i1 Y)) s> 0 --> X & ~Y
(zext i1 X) + (sext i1 Y)) s< 0 --> ~X & Y
(zext i1 X) + (sext i1 Y)) != 1 --> ~X | Y
(zext i1 X) + (sext i1 Y)) s< 1 --> ~X | Y
(zext i1 X) + (sext i1 Y)) u> 1 --> ~X & Y
```

All alive proofs:
https://alive2.llvm.org/ce/z/KmgDpF
https://alive2.llvm.org/ce/z/fLwWa9
https://alive2.llvm.org/ce/z/ZKQn2P

Fix: https://github.com/llvm/llvm-project/issues/59666

Reviewed By: spatel

Differential Revision: https://reviews.llvm.org/D143373

show more ...


# f93da396 15-Feb-2023 chenglin.bi <chenglin.bi@linaro.org>

[Instcombine] Precommit tests for icmp range; NFC


Revision tags: llvmorg-16.0.0-rc2
# 1c345c18 07-Feb-2023 chenglin.bi <chenglin.bi@linaro.org>

[Instcombine] Precommit tests for D143373; NFC


# 322a2ed3 06-Feb-2023 chenglin.bi <chenglin.bi@linaro.org>

[InstCombine] precommit tests for icmp with bool range; NFC


Revision tags: 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
# 2bf6123f 31-May-2022 Sanjay Patel <spatel@rotateright.com>

[InstCombine] fold icmp of sext bool based on limited range

X <=u (sext i1 Y) --> (X == 0) | Y

https://alive2.llvm.org/ce/z/W_tZzo

This is the conjugate/sibling pattern suggested with D126171
for

[InstCombine] fold icmp of sext bool based on limited range

X <=u (sext i1 Y) --> (X == 0) | Y

https://alive2.llvm.org/ce/z/W_tZzo

This is the conjugate/sibling pattern suggested with D126171
for a sign-extended bool value.

show more ...


# f3fe3844 31-May-2022 Sanjay Patel <spatel@rotateright.com>

[InstCombine] add tests for icmp of sext i1; NFC

These are adapted from the zext tests added for D126171.


Revision tags: llvmorg-14.0.4
# 1ebad988 23-May-2022 Sanjay Patel <spatel@rotateright.com>

[InstCombine] fold icmp of zext bool based on limited range

X <u (zext i1 Y) --> (X == 0) && Y

https://alive2.llvm.org/ce/z/avQDRY

This is a generalization of 4069cccf3b4ff4a based on the post-com

[InstCombine] fold icmp of zext bool based on limited range

X <u (zext i1 Y) --> (X == 0) && Y

https://alive2.llvm.org/ce/z/avQDRY

This is a generalization of 4069cccf3b4ff4a based on the post-commit suggestion.
This also adds the i1 type check and tests that were missing from the earlier
attempt; that commit caused several bot fails and was reverted.

Differential Revision: https://reviews.llvm.org/D126171

show more ...


# 6793c63e 22-May-2022 Sanjay Patel <spatel@rotateright.com>

[InstCombine] add tests for icmp of zext i1; NFC


# cba0ebd5 22-May-2022 Sanjay Patel <spatel@rotateright.com>

Revert "[InstCombine] fold icmp with sub and bool"

This reverts commit 4069cccf3b4ff4afb743d3d371ead9e2d5491e3a.
This causes bot failures, and there's a possibly a better way to get this and other p

Revert "[InstCombine] fold icmp with sub and bool"

This reverts commit 4069cccf3b4ff4afb743d3d371ead9e2d5491e3a.
This causes bot failures, and there's a possibly a better way to get this and other patterns.

show more ...


# 4069cccf 22-May-2022 Sanjay Patel <spatel@rotateright.com>

[InstCombine] fold icmp with sub and bool

This is the specific pattern seen in #53432, but it can be extended
in multiple ways:
1. The 'zext' could be an 'and'
2. The 'sub' could be some other binop

[InstCombine] fold icmp with sub and bool

This is the specific pattern seen in #53432, but it can be extended
in multiple ways:
1. The 'zext' could be an 'and'
2. The 'sub' could be some other binop with a similar ==0 property (udiv).

There might be some way to generalize using knownbits, but that
would require checking that the 'bool' value is created with
some instruction that can be replaced with new icmp+logic.

https://alive2.llvm.org/ce/z/-KCfpa

show more ...


12