[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
Tue Dec 17 13:57:39 PST 2024


andjo403 wrote:

think that I can close this PR as it looks better to move the fold done in `foldAndOrOfICmpsOfAndWithPow2` in to `foldLogOpOfMaskedICmps` and then `trunc x to i1` pattern only need to be handled in `getMaskedTypeForICmpPair`.

but the question still is if I shall try to find/fix regressions due to the removed `trunc X to i1`  into  `(X & 1) != 0` or as @dtcxzyw suggest reverting https://github.com/llvm/llvm-project/pull/84628

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


More information about the llvm-commits mailing list