diff options
| author | Yingwei Zheng <dtcxzyw2333@gmail.com> | 2023-09-18 21:32:48 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-18 21:32:48 +0800 |
| commit | be2723da5c5f2d7f7c3351813b749c0fcf631451 (patch) | |
| tree | e69824e3348920493d6c2092eb8f34da23ea2414 /llvm/lib/ProfileData/Coverage/CoverageMapping.cpp | |
| parent | fb4bdf361feecfd0863c1553ec14ef9928027a24 (diff) | |
| download | llvm-be2723da5c5f2d7f7c3351813b749c0fcf631451.zip llvm-be2723da5c5f2d7f7c3351813b749c0fcf631451.tar.gz llvm-be2723da5c5f2d7f7c3351813b749c0fcf631451.tar.bz2 | |
[InstSimplify] Fold icmp of `X and/or C1` and `X and/or C2` into constant (#65905)
This patch simplifies the pattern `icmp X and/or C1, X and/or C2` when
one constant mask is the subset of the other.
If `C1 & C2 == C1`, `A = X and/or C1`, `B = X and/or C2`, we can do the
following folds:
`icmp ule A, B -> true`
`icmp ugt A, B -> false`
We can apply similar folds for signed predicates when `C1` and `C2` are
the same sign:
`icmp sle A, B -> true`
`icmp sgt A, B -> false`
Alive2: https://alive2.llvm.org/ce/z/Q4ekP5
Fixes #65833.
Diffstat (limited to 'llvm/lib/ProfileData/Coverage/CoverageMapping.cpp')
0 files changed, 0 insertions, 0 deletions
