[llvm] [InstCombine] Fold (trunc X to i1) & !iszero(X & Pow2)) -> (X & (1 | Pow2)) == (1 | Pow2) (PR #119196)

Andreas Jonson via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 14 02:14:00 PST 2024


andjo403 wrote:

> I mean that we should pass a value instead of an`ICmpInst` into `foldLogOpOfMaskedICmps`, then we can handle this pattern in `decomposeBitTestICmp` and reuse the remaining fold logic.

This fold is not covered by `foldLogOpOfMaskedICmps ` so that is also a fold that need to handle `trunc X to i1`

one down side if https://github.com/llvm/llvm-project/pull/84628 is reverted is that it will be harder to find this type of missing folds if that change shall be applied again when the regressions is handled.

https://github.com/llvm/llvm-project/pull/119196


More information about the llvm-commits mailing list